diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index 387dabe747ab8..8b06772412244 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -2865,8 +2865,8 @@ E0370: r##" The maximum value of an enum was reached, so it cannot be automatically set in the next enum value. Erroneous code example: -```compile_fail -#[deny(overflowing_literals)] +```compile_fail,E0370 +#[repr(i64)] enum Foo { X = 0x7fffffffffffffff, 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 with the maximum value at the end of the enum. Examples: ``` +#[repr(i64)] enum Foo { X = 0x7fffffffffffffff, Y = 0, // ok! @@ -2888,6 +2889,7 @@ enum Foo { Or: ``` +#[repr(i64)] enum Foo { Y = 0, // ok! X = 0x7fffffffffffffff,