You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Confusing error for missing From impls (and other traits with blanket impls) #104712
structA;structB;fnfoo(){let a = A;let b = B::from(a);}
The current output is:
error[[E0308]](https://doc.rust-lang.org/stable/error-index.html#E0308): mismatched types
--> src/lib.rs:6:21
|
6 | let b = B::from(a);
| ------- ^ expected struct `B`, found struct `A`
| |
| arguments to this function are incorrect
|
note: associated function defined here
Ideally the output should look like:
error: type `B` doesn't implement `From<A>`
--> src/lib.rs:6:21
|
6 | let b = B::from(a);
| ------- ^ expected struct `B`, found struct `A`
|
note: type `B` has a blanket implementation
impl<T> From<T> for T
Activity
steffahn commentedon Nov 22, 2022
I guess it makes sense to also leave a link to the URLO discussion where we’re coming from.
estebank commentedon Oct 21, 2026
Do people think the following which is introduced by #164702 is enough?
Rollup merge of rust-lang#164702 - estebank:point-at-blanket, r=mejrs
Rollup merge of rust-lang#164702 - estebank:point-at-blanket, r=mejrs
Rollup merge of rust-lang#164702 - estebank:point-at-blanket, r=mejrs
Unrolled build for #164702 in rollup 165002
Rollup merge of #164702 - estebank:point-at-blanket, r=mejrs