mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +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.6 KiB
Plaintext
41 lines
1.6 KiB
Plaintext
error[E0080]: evaluation of `<Bar<u16, u8> as Foo>::AMT` failed
|
|
--> $DIR/issue-44578.rs:13:24
|
|
|
|
|
LL | const AMT: usize = [A::AMT][(A::AMT > B::AMT) as usize];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ index out of bounds: the length is 1 but the index is 1
|
|
|
|
note: erroneous constant encountered
|
|
--> $DIR/issue-44578.rs:25:20
|
|
|
|
|
LL | println!("{}", <Bar<u16, u8> as Foo>::AMT);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
note: erroneous constant encountered
|
|
--> $DIR/issue-44578.rs:25:20
|
|
|
|
|
LL | println!("{}", <Bar<u16, u8> as Foo>::AMT);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
|
|
|
note: erroneous constant encountered
|
|
--> $DIR/issue-44578.rs:25:20
|
|
|
|
|
LL | println!("{}", <Bar<u16, u8> as Foo>::AMT);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: this note originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
note: erroneous constant encountered
|
|
--> $DIR/issue-44578.rs:25:20
|
|
|
|
|
LL | println!("{}", <Bar<u16, u8> as Foo>::AMT);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
|
= note: this note originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (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`.
|