rust/compiler/rustc_middle
Guillaume Boisseau 5ff9022306
Rollup merge of #121059 - compiler-errors:extension, r=davidtwco,Nilstrieb
Add and use a simple extension trait derive macro in the compiler

Adds `#[extension]` to `rustc_macros` for implementing an extension trait. This expands an impl (with an optional visibility) into two parallel trait + impl definitions.

before:
```rust
pub trait Extension {
  fn a();
}
impl Extension for () {
  fn a() {}
}
```

to:
```rust
#[extension]
pub impl Extension for () {
  fn a() {}
}
```

Opted to just implement it by hand because I couldn't figure if there was a "canonical" choice of extension trait macro in the ecosystem. It's really lightweight anyways, and can always be changed.

I'm interested in adding this because I'd like to later split up the large `TypeErrCtxtExt` traits into several different files. This should make it one step easier.
2024-02-17 11:23:04 +01:00
..
src Rollup merge of #121059 - compiler-errors:extension, r=davidtwco,Nilstrieb 2024-02-17 11:23:04 +01:00
Cargo.toml Update measureme crate to version 11 2024-01-13 16:32:03 +01:00
messages.ftl Add a custom panic message for resuming gen blocks after they panicked 2023-10-30 10:23:57 +00:00
README.md

For more information about how rustc works, see the rustc dev guide.