Skip to content

Commit bc79f20

Browse files
Add E0404 error explanation
1 parent cd385cb commit bc79f20

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

src/librustc_resolve/diagnostics.rs

+26-1
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,32 @@ fn foo<T, Y>(s: T, u: Y) {} // ok!
290290
```
291291
"##,
292292

293+
E0404: r##"
294+
You tried to implement a non-trait object on an object. Example of erroneous
295+
code:
296+
297+
```
298+
struct Foo;
299+
struct Bar;
300+
301+
impl Foo for Bar {} // error: `Foo` is not a trait
302+
```
303+
304+
Please verify you didn't mispelled the trait's name or used the wrong object.
305+
Example:
306+
307+
```
308+
trait Foo {
309+
// some functions
310+
}
311+
struct Bar;
312+
313+
impl Foo for Bar { // ok!
314+
// functions implementation
315+
}
316+
```
317+
"##,
318+
293319
E0405: r##"
294320
You tried to implement an undefined trait on an object. Example of
295321
erroneous code:
@@ -330,7 +356,6 @@ register_diagnostics! {
330356
E0258,
331357
E0401, // can't use type parameters from outer function
332358
E0402, // cannot use an outer type parameter in this context
333-
E0404, // is not a trait
334359
E0406, // undeclared associated type
335360
E0407, // method is not a member of trait
336361
E0408, // variable from pattern #1 is not bound in pattern #

0 commit comments

Comments
 (0)