File tree 1 file changed +51
-2
lines changed
1 file changed +51
-2
lines changed Original file line number Diff line number Diff line change @@ -426,6 +426,57 @@ use something_which_doesnt_exist;
426
426
Please verify you didn't misspell the import's name.
427
427
"## ,
428
428
429
+ E0437 : r##"
430
+ Trait impls can only implement associated types that are members of the trait in
431
+ question. This error indicates that you attempted to implement an associated
432
+ type whose name does not match the name of any associated type in the trait.
433
+
434
+ Here is an example that demonstrates the error:
435
+
436
+ ```
437
+ trait Foo {}
438
+
439
+ impl Foo for i32 {
440
+ type Bar = bool;
441
+ }
442
+ ```
443
+
444
+ The solution to this problem is to remove the extraneous associated type:
445
+
446
+ ```
447
+ trait Foo {}
448
+
449
+ impl Foo for i32 {}
450
+ ```
451
+ "## ,
452
+
453
+ E0438 : r##"
454
+ Trait impls can only implement associated constants that are members of the
455
+ trait in question. This error indicates that you attempted to implement an
456
+ associated constant whose name does not match the name of any associated
457
+ constant in the trait.
458
+
459
+ Here is an example that demonstrates the error:
460
+
461
+ ```
462
+ #![feature(associated_consts)]
463
+
464
+ trait Foo {}
465
+
466
+ impl Foo for i32 {
467
+ const BAR: bool = true;
468
+ }
469
+ ```
470
+
471
+ The solution to this problem is to remove the extraneous associated constant:
472
+
473
+ ```
474
+ trait Foo {}
475
+
476
+ impl Foo for i32 {}
477
+ ```
478
+ "##
479
+
429
480
}
430
481
431
482
register_diagnostics ! {
@@ -468,6 +519,4 @@ register_diagnostics! {
468
519
E0432 , // unresolved import
469
520
E0434 , // can't capture dynamic environment in a fn item
470
521
E0435 , // attempt to use a non-constant value in a constant
471
- E0437 , // type is not a member of trait
472
- E0438 , // const is not a member of trait
473
522
}
You can’t perform that action at this time.
0 commit comments