]> git.lizzy.rs Git - rust.git/commitdiff
clean E0271 explanation
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Wed, 5 Feb 2020 22:03:03 +0000 (23:03 +0100)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Wed, 5 Feb 2020 22:03:03 +0000 (23:03 +0100)
src/librustc_error_codes/error_codes/E0271.md

index 4078598b394151194a668d306bdf7b9c4eecf3ec..31334069ed8a404ed0a729c702d4ac55747dd2d7 100644 (file)
@@ -1,9 +1,6 @@
-This is because of a type mismatch between the associated type of some
-trait (e.g., `T::Bar`, where `T` implements `trait Quux { type Bar; }`)
-and another type `U` that is required to be equal to `T::Bar`, but is not.
-Examples follow.
+A type mismatched an associated type of a trait.
 
-Here is a basic example:
+Erroneous code example:
 
 ```compile_fail,E0271
 trait Trait { type AssociatedType; }
@@ -17,6 +14,11 @@ impl Trait for i8 { type AssociatedType = &'static str; }
 foo(3_i8);
 ```
 
+This is because of a type mismatch between the associated type of some
+trait (e.g., `T::Bar`, where `T` implements `trait Quux { type Bar; }`)
+and another type `U` that is required to be equal to `T::Bar`, but is not.
+Examples follow.
+
 Here is that same example again, with some explanatory comments:
 
 ```compile_fail,E0271