@@ -282,10 +282,41 @@ fn foo<T, T>(s: T, u: T) {} // error: the name `T` is already used for a type
282
282
// parameter in this type parameter list
283
283
```
284
284
285
- Please verify you didn't mispell the type parameters. Example:
285
+ Please verify that none of the type params are misspelled, and rename any
286
+ clashing parameters. Example:
286
287
287
288
```
288
- fn foo<T, Y>(s: T, u: Y) {}
289
+ fn foo<T, Y>(s: T, u: Y) {} // ok!
290
+ ```
291
+ "## ,
292
+
293
+ E0405 : r##"
294
+ You tried to implement an undefined trait on an object. Example of
295
+ erroneous code:
296
+
297
+ ```
298
+ struct Foo;
299
+
300
+ impl SomeTrait for Foo {} // error: use of undeclared trait name `SomeTrait`
301
+ ```
302
+
303
+ Please verify that the name of the trait wasn't misspelled and ensure that it
304
+ was imported. Example:
305
+
306
+ ```
307
+ // solution 1:
308
+ use some_file::SomeTrait;
309
+
310
+ // solution 2:
311
+ trait SomeTrait {
312
+ // some functions
313
+ }
314
+
315
+ struct Foo;
316
+
317
+ impl SomeTrait for Foo { // ok!
318
+ // implements functions
319
+ }
289
320
```
290
321
"##
291
322
@@ -300,7 +331,6 @@ register_diagnostics! {
300
331
E0401 , // can't use type parameters from outer function
301
332
E0402 , // cannot use an outer type parameter in this context
302
333
E0404 , // is not a trait
303
- E0405 , // use of undeclared trait name
304
334
E0406 , // undeclared associated type
305
335
E0407 , // method is not a member of trait
306
336
E0408 , // variable from pattern #1 is not bound in pattern #
0 commit comments