Add more regression tests

This commit is contained in:
Oliver Scherer 2018-11-08 20:18:26 +01:00
parent df10965dc0
commit ffa7ce4290
2 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,5 @@
fn main() {
enum Enum { One=1 }
let xs=[0;1 as usize];
println!("{}", xs[Enum::One as usize]); //~ ERROR the len is 1 but the index is 1
}

View File

@ -0,0 +1,10 @@
error: index out of bounds: the len is 1 but the index is 1
--> $DIR/const-prop-ice2.rs:4:20
|
LL | println!("{}", xs[Enum::One as usize]); //~ ERROR the len is 1 but the index is 1
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[deny(const_err)] on by default
error: aborting due to previous error