Commit Graph

3 Commits

Author SHA1 Message Date
Nicholas Nethercote
ebfac4ecaf 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.
2025-08-19 18:16:57 +10:00
Jakub Beránek
a6a760edaf Remove the From derive macro from prelude
To avoid backwards compatibility problems.
2025-08-18 13:12:19 +02:00
Jakub Beránek
1f3a7471bf Implement #[derive(From)] 2025-08-15 12:07:15 +02:00