diff options
Diffstat (limited to 'src/test/ui/consts/const-err.rs')
| -rw-r--r-- | src/test/ui/consts/const-err.rs | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/test/ui/consts/const-err.rs b/src/test/ui/consts/const-err.rs index 8683f6a0231..fff50c86646 100644 --- a/src/test/ui/consts/const-err.rs +++ b/src/test/ui/consts/const-err.rs @@ -10,23 +10,17 @@ // compile-flags: -Zforce-overflow-checks=on -// these errors are not actually "const_err", they occur in codegen/consts -// and are unconditional warnings that can't be denied or allowed - #![allow(exceeding_bitshifts)] -#![allow(const_err)] +#![warn(const_err)] fn black_box<T>(_: T) { unimplemented!() } -// Make sure that the two uses get two errors. const FOO: u8 = [5u8][1]; -//~^ ERROR constant evaluation error -//~| index out of bounds: the len is 1 but the index is 1 +//~^ WARN any use of this value will cause an error fn main() { black_box((FOO, FOO)); - //~^ ERROR referenced constant has errors - //~| ERROR could not evaluate constant + //~^ ERROR erroneous constant used } |
