about summary refs log tree commit diff
path: root/compiler/rustc_errors/src/snippet.rs
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2025-08-19 19:50:03 +0800
committerGitHub <noreply@github.com>2025-08-19 19:50:03 +0800
commite462a7daa0b2a16152e26bdc34ac92e80884735f (patch)
tree61c59b096bb2476fe214e62a44d3abf94071c7d2 /compiler/rustc_errors/src/snippet.rs
parentcd597ae1800825a267712cdfabea48e507116a35 (diff)
parentebfac4ecaf4190dada6dba95645ceee7efd2ca38 (diff)
downloadrust-e462a7daa0b2a16152e26bdc34ac92e80884735f.tar.gz
rust-e462a7daa0b2a16152e26bdc34ac92e80884735f.zip
Rollup merge of #145550 - nnethercote:derive_from-no-unit, r=Kobzol
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.

r? ``@Kobzol``
Diffstat (limited to 'compiler/rustc_errors/src/snippet.rs')
0 files changed, 0 insertions, 0 deletions