diff options
| author | Nickolay Ponomarev <asqueella@gmail.com> | 2019-04-28 22:32:28 +0300 |
|---|---|---|
| committer | Nickolay Ponomarev <asqueella@gmail.com> | 2019-04-28 23:01:26 +0300 |
| commit | 35f1c2fd1306e0824ab4ac4d9fac7595e0937174 (patch) | |
| tree | 7ae8ac1a2a5d1dbd1346f9d8b4609659ea6b14ff | |
| parent | bdfdbcd44d457b2ac6d0cea4fb71739d3166cb98 (diff) | |
| download | rust-35f1c2fd1306e0824ab4ac4d9fac7595e0937174.tar.gz rust-35f1c2fd1306e0824ab4ac4d9fac7595e0937174.zip | |
Clarify the short explanation of E0207
- Use the terms from the reference <https://doc.rust-lang.org/reference/items/implementations.html> - Add code snippets to explain the terms
| -rw-r--r-- | src/librustc_typeck/error_codes.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/librustc_typeck/error_codes.rs b/src/librustc_typeck/error_codes.rs index ba67593ce96..ab4ab46341d 100644 --- a/src/librustc_typeck/error_codes.rs +++ b/src/librustc_typeck/error_codes.rs @@ -1943,9 +1943,11 @@ E0207: r##" 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 @@ -1964,9 +1966,9 @@ impl<T: Default> Foo { } ``` -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`: ``` |
