Skip to content

Commit e7296fd

Browse files
authored
Fix error index E0370 doctests on 32 bit platforms
1 parent c654968 commit e7296fd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/librustc_typeck/diagnostics.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -2865,8 +2865,8 @@ E0370: r##"
28652865
The maximum value of an enum was reached, so it cannot be automatically
28662866
set in the next enum value. Erroneous code example:
28672867
2868-
```compile_fail
2869-
#[deny(overflowing_literals)]
2868+
```compile_fail,E0370
2869+
#[repr(i64)]
28702870
enum Foo {
28712871
X = 0x7fffffffffffffff,
28722872
Y, // error: enum discriminant overflowed on value after
@@ -2879,6 +2879,7 @@ To fix this, please set manually the next enum value or put the enum variant
28792879
with the maximum value at the end of the enum. Examples:
28802880
28812881
```
2882+
#[repr(i64)]
28822883
enum Foo {
28832884
X = 0x7fffffffffffffff,
28842885
Y = 0, // ok!
@@ -2888,6 +2889,7 @@ enum Foo {
28882889
Or:
28892890
28902891
```
2892+
#[repr(i64)]
28912893
enum Foo {
28922894
Y = 0, // ok!
28932895
X = 0x7fffffffffffffff,

0 commit comments

Comments
 (0)