File tree 1 file changed +7
-5
lines changed
src/librustc_error_codes/error_codes
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.
5
2
6
- Here is a basic example:
3
+ Erroneous code example:
7
4
8
5
``` compile_fail,E0271
9
6
trait Trait { type AssociatedType; }
@@ -17,6 +14,11 @@ impl Trait for i8 { type AssociatedType = &'static str; }
17
14
foo(3_i8);
18
15
```
19
16
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
+
20
22
Here is that same example again, with some explanatory comments:
21
23
22
24
``` compile_fail,E0271
You can’t perform that action at this time.
0 commit comments