]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-err.rs
Do not suggest `let_else` if no bindings would be introduced
[rust.git] / src / test / ui / consts / const-err.rs
1 // build-fail
2 // compile-flags: -C overflow-checks=on
3
4 #![allow(arithmetic_overflow)]
5 #![warn(const_err)]
6
7 fn black_box<T>(_: T) {
8     unimplemented!()
9 }
10
11 const FOO: u8 = [5u8][1];
12 //~^ WARN any use of this value will cause an error
13 //~| WARN this was previously accepted by the compiler but is being phased out
14
15 fn main() {
16     black_box((FOO, FOO));
17     //~^ ERROR erroneous constant used
18     //~| ERROR erroneous constant
19 }