]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/issue-69020.rs
add test for issue 69020
[rust.git] / src / test / ui / consts / issue-69020.rs
1 // revisions: default noopt opt opt_with_overflow_checks
2 //[noopt]compile-flags: -C opt-level=0
3 //[opt]compile-flags: -O
4 //[opt_with_overflow_checks]compile-flags: -C overflow-checks=on -O
5
6 #![crate_type="lib"]
7
8 use std::i32;
9
10 pub trait Foo {
11     const N: i32;
12 }
13
14 impl<T: Foo> Foo for Vec<T> {
15     const N: i32 = -i32::MIN + T::N;
16     //~^ ERROR arithmetic operation will overflow
17 }