mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
5010ca001c
This fixes the issue wherein the lint didn't fire for promoteds in the case of SHL/SHR operators in non-optimized builds and all arithmetic operators in optimized builds
41 lines
1.5 KiB
Plaintext
41 lines
1.5 KiB
Plaintext
error[E0080]: evaluation of `<() as Tr>::B` failed
|
|
--> $DIR/defaults-not-assumed-fail.rs:8:19
|
|
|
|
|
LL | const B: u8 = Self::A + 1;
|
|
| ^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow
|
|
|
|
note: erroneous constant encountered
|
|
--> $DIR/defaults-not-assumed-fail.rs:33:16
|
|
|
|
|
LL | assert_eq!(<() as Tr>::B, 0); // causes the error above
|
|
| ^^^^^^^^^^^^^
|
|
|
|
note: erroneous constant encountered
|
|
--> $DIR/defaults-not-assumed-fail.rs:33:16
|
|
|
|
|
LL | assert_eq!(<() as Tr>::B, 0); // causes the error above
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
|
|
|
note: erroneous constant encountered
|
|
--> $DIR/defaults-not-assumed-fail.rs:33:5
|
|
|
|
|
LL | assert_eq!(<() as Tr>::B, 0); // causes the error above
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
note: erroneous constant encountered
|
|
--> $DIR/defaults-not-assumed-fail.rs:33:5
|
|
|
|
|
LL | assert_eq!(<() as Tr>::B, 0); // causes the error above
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
|
= note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
error: aborting due to 1 previous error
|
|
|
|
For more information about this error, try `rustc --explain E0080`.
|