diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2015-06-19 13:58:15 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2015-06-19 13:58:15 +0200 |
| commit | 04888e7c600fed71d989937cc8f582bea83423a2 (patch) | |
| tree | 4a9c3f5361715a2cd72fbfeb9b63e2b6367dc093 | |
| parent | 00e115d090180c9fe13856500576978ff3007cda (diff) | |
Add E0035 error explanation
| -rw-r--r-- | src/librustc_typeck/diagnostics.rs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index a9fe1a1f82b..c95dbd3ca13 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -211,6 +211,40 @@ Reference: http://doc.rust-lang.org/reference.html#trait-objects "##, +E0035: r##" +You tried to give a type parameter where it wasn't needed. Bad example: + +``` +struct Test; + +impl Test { + fn method(&self) {} +} + +fn main() { + let x = Test; + + x.method::<i32>(); // Error: Test::method doesn't need type parameter! +} +``` + +To fix this error, just remove the type parameter: + +``` +struct Test; + +impl Test { + fn method(&self) {} +} + +fn main() { + let x = Test; + + x.method(); // OK, we're good! +} +``` +"##, + E0036: r##" This error occurrs when you pass too many or not enough type parameters to a method. Example: |
