Skip to content

Commit

Permalink
Add more regression tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Nov 8, 2018
1 parent df10965 commit ffa7ce4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/test/ui/consts/const-prop-ice2.rs
@@ -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
}
10 changes: 10 additions & 0 deletions src/test/ui/consts/const-prop-ice2.stderr
@@ -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

0 comments on commit ffa7ce4

Please sign in to comment.