diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-08-18 13:50:11 +1000 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2025-08-19 18:16:57 +1000 |
| commit | ebfac4ecaf4190dada6dba95645ceee7efd2ca38 (patch) | |
| tree | 4cd46c83bc0d212f215ac0870c3f1300743959c7 /compiler/rustc_errors/src/snippet.rs | |
| parent | 8365fcb2b840c95eeb0bc377af8bd498fad22245 (diff) | |
| download | rust-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
