File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
src/librustc_error_codes/error_codes Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 1- This is because of a type mismatch between the associated type of some
2- trait (e.g., ` T::Bar ` , where ` T ` implements ` trait Quux { type Bar; } ` )
3- and another type ` U ` that is required to be equal to ` T::Bar ` , but is not.
4- Examples follow.
1+ A type mismatched an associated type of a trait.
52
6- Here is a basic example:
3+ Erroneous code example:
74
85``` compile_fail,E0271
96trait Trait { type AssociatedType; }
@@ -17,6 +14,11 @@ impl Trait for i8 { type AssociatedType = &'static str; }
1714foo(3_i8);
1815```
1916
17+ This is because of a type mismatch between the associated type of some
18+ trait (e.g., ` T::Bar ` , where ` T ` implements ` trait Quux { type Bar; } ` )
19+ and another type ` U ` that is required to be equal to ` T::Bar ` , but is not.
20+ Examples follow.
21+
2022Here is that same example again, with some explanatory comments:
2123
2224``` compile_fail,E0271
You can’t perform that action at this time.
0 commit comments