@@ -3630,6 +3630,44 @@ fn together_we_will_rule_the_galaxy(son: &A<i32>) {} // Ok!
3630
3630
```
3631
3631
"## ,
3632
3632
3633
+ E0399 : r##"
3634
+ You implemented a trait, overriding one or more of its associated types but did
3635
+ not reimplement its default methods.
3636
+
3637
+ Example of erroneous code:
3638
+
3639
+ ```compile_fail,E0399
3640
+ #![feature(associated_type_defaults)]
3641
+
3642
+ pub trait Foo {
3643
+ type Assoc = u8;
3644
+ fn bar(&self) {}
3645
+ }
3646
+
3647
+ impl Foo for i32 {
3648
+ // error - the following trait items need to be reimplemented as
3649
+ // `Assoc` was overridden: `bar`
3650
+ type Assoc = i32;
3651
+ }
3652
+ ```
3653
+
3654
+ To fix this, add an implementation for each default method from the trait:
3655
+
3656
+ ```
3657
+ #![feature(associated_type_defaults)]
3658
+
3659
+ pub trait Foo {
3660
+ type Assoc = u8;
3661
+ fn bar(&self) {}
3662
+ }
3663
+
3664
+ impl Foo for i32 {
3665
+ type Assoc = i32;
3666
+ fn bar(&self) {} // ok!
3667
+ }
3668
+ ```
3669
+ "## ,
3670
+
3633
3671
E0439 : r##"
3634
3672
The length of the platform-intrinsic function `simd_shuffle`
3635
3673
wasn't specified. Erroneous code example:
@@ -4161,8 +4199,6 @@ register_diagnostics! {
4161
4199
// E0372, // coherence not object safe
4162
4200
E0377 , // the trait `CoerceUnsized` may only be implemented for a coercion
4163
4201
// between structures with the same definition
4164
- E0399 , // trait items need to be implemented because the associated
4165
- // type `{}` was overridden
4166
4202
E0436 , // functional record update requires a struct
4167
4203
E0521 , // redundant default implementations of trait
4168
4204
E0533 , // `{}` does not name a unit variant, unit struct or a constant
0 commit comments