Skip to content

Commit e4adf5f

Browse files
---
yaml --- r: 233774 b: refs/heads/beta c: acafe3b h: refs/heads/master v: v3
1 parent f8d1118 commit e4adf5f

File tree

2 files changed

+33
-4
lines changed

2 files changed

+33
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 805e4e6fd1e5dccf20e58322e4d0540fdb871b9b
26+
refs/heads/beta: acafe3b730cab343ce76c3c03bbf158393772782
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/librustc_typeck/diagnostics.rs

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ struct Foo {
8484
8585
fn main(){
8686
let x = Foo { a:1, b:2 };
87-
87+
8888
let Foo { a: x, a: y } = x;
8989
// error: field `a` bound multiple times in the pattern
9090
}
@@ -102,7 +102,7 @@ struct Foo {
102102
103103
fn main(){
104104
let x = Foo { a:1, b:2 };
105-
105+
106106
let Foo { a: x, b: y } = x; // ok!
107107
}
108108
```
@@ -2820,6 +2820,36 @@ It is also possible to overload most operators for your own type by
28202820
implementing traits from `std::ops`.
28212821
"##,
28222822

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+
28232853
E0371: r##"
28242854
When `Trait2` is a subtrait of `Trait1` (for example, when `Trait2` has a
28252855
definition like `trait Trait2: Trait1 { ... }`), it is not allowed to implement
@@ -3037,7 +3067,6 @@ register_diagnostics! {
30373067
E0321, // extended coherence rules for defaulted traits violated
30383068
E0328, // cannot implement Unsize explicitly
30393069
E0329, // associated const depends on type parameter or Self.
3040-
E0370, // discriminant overflow
30413070
E0374, // the trait `CoerceUnsized` may only be implemented for a coercion
30423071
// between structures with one field being coerced, none found
30433072
E0375, // the trait `CoerceUnsized` may only be implemented for a coercion

0 commit comments

Comments
 (0)