]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/error_codes.rs
Rollup merge of #60756 - matthewjasper:extra-impl-trait-tests, r=nikomatsakis
[rust.git] / src / librustc_typeck / error_codes.rs
index 0b435be7bfc8ad2010971e8c9a7a5e08d7a3a8dd..6dd3c0113cdcda97b48e906a35fb8731557726fe 100644 (file)
@@ -1,4 +1,5 @@
-// ignore-tidy-linelength
+// ignore-tidy-filelength
+
 #![allow(non_snake_case)]
 
 register_long_diagnostics! {
@@ -1941,9 +1942,11 @@ impl Copy for &'static mut Bar { } // error
 Any type parameter or lifetime parameter of an `impl` must meet at least one of
 the following criteria:
 
- - it appears in the self type of the impl
- - for a trait impl, it appears in the trait reference
- - it is bound as an associated type
+ - it appears in the _implementing type_ of the impl, e.g. `impl<T> Foo<T>`
+ - for a trait impl, it appears in the _implemented trait_, e.g.
+   `impl<T> SomeTrait<T> for Foo`
+ - it is bound as an associated type, e.g. `impl<T, U> SomeTrait for T
+   where T: AnotherTrait<AssocType=U>`
 
 ### Error example 1
 
@@ -1962,9 +1965,9 @@ fn get(&self) -> T {
 }
 ```
 
-The problem is that the parameter `T` does not appear in the self type (`Foo`)
-of the impl. In this case, we can fix the error by moving the type parameter
-from the `impl` to the method `get`:
+The problem is that the parameter `T` does not appear in the implementing type
+(`Foo`) of the impl. In this case, we can fix the error by moving the type
+parameter from the `impl` to the method `get`:
 
 
 ```