diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2015-07-17 14:55:42 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2015-07-21 19:28:58 +0200 |
| commit | bc79f20ccac4ead82fae1464ea0916e78e04616f (patch) | |
| tree | bd34ef58d7d638165db6c33386479f6b18a1ea98 /src | |
| parent | cd385cbe34d8a9bad2a6d03c1ef50dd04642a379 (diff) | |
| download | rust-bc79f20ccac4ead82fae1464ea0916e78e04616f.tar.gz rust-bc79f20ccac4ead82fae1464ea0916e78e04616f.zip | |
Add E0404 error explanation
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_resolve/diagnostics.rs | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs index 428e084064e..d83829150c5 100644 --- a/src/librustc_resolve/diagnostics.rs +++ b/src/librustc_resolve/diagnostics.rs @@ -290,6 +290,32 @@ fn foo<T, Y>(s: T, u: Y) {} // ok! ``` "##, +E0404: r##" +You tried to implement a non-trait object on an object. Example of erroneous +code: + +``` +struct Foo; +struct Bar; + +impl Foo for Bar {} // error: `Foo` is not a trait +``` + +Please verify you didn't mispelled the trait's name or used the wrong object. +Example: + +``` +trait Foo { + // some functions +} +struct Bar; + +impl Foo for Bar { // ok! + // functions implementation +} +``` +"##, + E0405: r##" You tried to implement an undefined trait on an object. Example of erroneous code: @@ -330,7 +356,6 @@ register_diagnostics! { E0258, E0401, // can't use type parameters from outer function E0402, // cannot use an outer type parameter in this context - E0404, // is not a trait E0406, // undeclared associated type E0407, // method is not a member of trait E0408, // variable from pattern #1 is not bound in pattern # |
