Show detailed expected/found types in error message when trait paths are the same

This commit is contained in:
rhysd 2021-10-08 01:00:15 +09:00
parent ca8078d7b2
commit 7b9ddbdcf2
9 changed files with 87 additions and 20 deletions

View file

@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | impl Eq for &dyn DynEq {}
| ^^ lifetime mismatch
|
= note: expected trait `PartialEq`
found trait `PartialEq`
= note: expected trait `<&dyn DynEq as PartialEq>`
found trait `<&(dyn DynEq + 'static) as PartialEq>`
note: the lifetime `'_` as defined on the impl at 9:13...
--> $DIR/E0308-2.rs:9:13
|