@@ -84,7 +84,7 @@ struct Foo {
84
84
85
85
fn main(){
86
86
let x = Foo { a:1, b:2 };
87
-
87
+
88
88
let Foo { a: x, a: y } = x;
89
89
// error: field `a` bound multiple times in the pattern
90
90
}
@@ -102,7 +102,7 @@ struct Foo {
102
102
103
103
fn main(){
104
104
let x = Foo { a:1, b:2 };
105
-
105
+
106
106
let Foo { a: x, b: y } = x; // ok!
107
107
}
108
108
```
@@ -2820,6 +2820,36 @@ It is also possible to overload most operators for your own type by
2820
2820
implementing traits from `std::ops`.
2821
2821
"## ,
2822
2822
2823
+ E0370 : r##"
2824
+ The maximum value of an enum was reached, so it cannot be automatically
2825
+ set in the next enum value. Erroneous code example:
2826
+
2827
+ ```
2828
+ enum Foo {
2829
+ X = 0x7fffffffffffffff,
2830
+ Y // error: enum discriminant overflowed on value after
2831
+ // 9223372036854775807: i64; set explicitly via
2832
+ // Y = -9223372036854775808 if that is desired outcome
2833
+ }
2834
+ ```
2835
+
2836
+ To fix this, please set manually the next enum value or put the enum variant
2837
+ with the maximum value at the end of the enum. Examples:
2838
+
2839
+ ```
2840
+ enum Foo {
2841
+ X = 0x7fffffffffffffff,
2842
+ Y = 0, // ok!
2843
+ }
2844
+
2845
+ // or:
2846
+ enum Foo {
2847
+ Y = 0, // ok!
2848
+ X = 0x7fffffffffffffff,
2849
+ }
2850
+ ```
2851
+ "## ,
2852
+
2823
2853
E0371 : r##"
2824
2854
When `Trait2` is a subtrait of `Trait1` (for example, when `Trait2` has a
2825
2855
definition like `trait Trait2: Trait1 { ... }`), it is not allowed to implement
@@ -3037,7 +3067,6 @@ register_diagnostics! {
3037
3067
E0321 , // extended coherence rules for defaulted traits violated
3038
3068
E0328 , // cannot implement Unsize explicitly
3039
3069
E0329 , // associated const depends on type parameter or Self.
3040
- E0370 , // discriminant overflow
3041
3070
E0374 , // the trait `CoerceUnsized` may only be implemented for a coercion
3042
3071
// between structures with one field being coerced, none found
3043
3072
E0375 , // the trait `CoerceUnsized` may only be implemented for a coercion
0 commit comments