rust/compiler/rustc_trait_selection
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 avoid always rerunning in case of a cycle 2024-01-09 11:19:34 +01:00
messages.ftl make better async fn kind errors 2024-02-15 15:59:35 +00:00