about summary refs log tree commit diff
path: root/compiler/rustc_errors/src/snippet.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2025-08-18 13:50:11 +1000
committerZalathar <Zalathar@users.noreply.github.com>2025-08-19 18:16:57 +1000
commitebfac4ecaf4190dada6dba95645ceee7efd2ca38 (patch)
tree4cd46c83bc0d212f215ac0870c3f1300743959c7 /compiler/rustc_errors/src/snippet.rs
parent8365fcb2b840c95eeb0bc377af8bd498fad22245 (diff)
downloadrust-ebfac4ecaf4190dada6dba95645ceee7efd2ca38.tar.gz
rust-ebfac4ecaf4190dada6dba95645ceee7efd2ca38.zip
Avoid using `()` in `derive(From)` output.
Using an error type instead of `()` avoids the duplicated errors
on `struct SUnsizedField` in `deriving-from-wrong-target.rs`. It also
improves the expanded output from this:
```
struct S2(u32, u32);
impl ::core::convert::From<()> for S2 {
    #[inline]
    fn from(value: ()) -> S2 { (/*ERROR*/) }
}
```
to this:
```
struct S2(u32, u32);
impl ::core::convert::From<(/*ERROR*/)> for S2 {
    #[inline]
    fn from(value: (/*ERROR*/)) -> S2 { (/*ERROR*/) }
}
```
The new code also only matchs on `item.kind` once.
Diffstat (limited to 'compiler/rustc_errors/src/snippet.rs')
0 files changed, 0 insertions, 0 deletions