Skip to content

Commit eb3ca1d

Browse files
---
yaml --- r: 232775 b: refs/heads/try c: acafe3b h: refs/heads/master i: 232773: fb2a9ff 232771: babe797 232767: 1d772f6 v: v3
1 parent 26ef9ca commit eb3ca1d

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: edeb4f1c86cbf6af8ef9874d4b3af50f721ea1b8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: 805e4e6fd1e5dccf20e58322e4d0540fdb871b9b
4+
refs/heads/try: acafe3b730cab343ce76c3c03bbf158393772782
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/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)