fix: Do not delay E0107 when there exists an assoc ty with the same name Fixes rust-lang/rust#148121 When we have the following code: ```rust trait Foo<T> {} impl Foo<T: Default> for String {} ``` we delay `E0107: wrong number of generic args` to suggest moving `T: Default` bound to the impl block's param declaration. The delay is determined by whether all the missing generic parameters are mentioned by those *wrong* assoc item constraints. But this delay is wrong when there exist any *correct* assoc item constraints, i.e. when we have an assoc type whose identifier is same with a missing generic parameter like in the following code: ```rust pub trait Super<X> { type X; } pub trait A {} impl A for dyn Super<X = ()> {} ``` |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| messages.ftl | ||
| README.md | ||
For high-level intro to how type checking works in rustc, see the hir typeck chapter of the rustc dev guide.