Skip to content

Commit c182461

Browse files
clean E0271 explanation
1 parent 320ada6 commit c182461

File tree

1 file changed

+7
-5
lines changed
  • src/librustc_error_codes/error_codes

1 file changed

+7
-5
lines changed

src/librustc_error_codes/error_codes/E0271.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
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
96
trait Trait { type AssociatedType; }
@@ -17,6 +14,11 @@ impl Trait for i8 { type AssociatedType = &'static str; }
1714
foo(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+
2022
Here is that same example again, with some explanatory comments:
2123

2224
```compile_fail,E0271

0 commit comments

Comments
 (0)