about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/errors.rs
diff options
context:
space:
mode:
authorGuillaume Boisseau <Nadrieril@users.noreply.github.com>2024-02-17 11:23:04 +0100
committerGitHub <noreply@github.com>2024-02-17 11:23:04 +0100
commit5ff90223065405c5c9ed154abaf01750e8f87591 (patch)
tree9a5aac708ba21319904b38b9b91b620a51d55949 /compiler/rustc_codegen_llvm/src/errors.rs
parentf70f13a1d3437041dee4c536f2872fae02c2f3e8 (diff)
parentf624d55ea77b1b24e9294818ee1d6b1da9d0ec2d (diff)
downloadrust-5ff90223065405c5c9ed154abaf01750e8f87591.tar.gz
rust-5ff90223065405c5c9ed154abaf01750e8f87591.zip
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.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/errors.rs')
0 files changed, 0 insertions, 0 deletions