1
Fork 0

Rollup merge of #55956 - euclio:issue-55587, r=estebank

add tests for some fixed ICEs

Fixes #55587.
Fixes #54348.

Looks like these ICEs are already fixed in nightly, so this PR just adds tests.

r? @estebank
This commit is contained in:
Pietro Albini 2018-11-15 11:04:47 +01:00 committed by GitHub
commit d0e08ce88e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 35 additions and 0 deletions

View file

@ -0,0 +1,5 @@
fn main() {
[1][0u64 as usize];
[1][1.5 as usize]; // ERROR index out of bounds
[1][1u64 as usize]; // ERROR index out of bounds
}

View file

@ -0,0 +1,16 @@
error: index out of bounds: the len is 1 but the index is 1
--> $DIR/issue-54348.rs:3:5
|
LL | [1][1.5 as usize]; // ERROR index out of bounds
| ^^^^^^^^^^^^^^^^^
|
= note: #[deny(const_err)] on by default
error: index out of bounds: the len is 1 but the index is 1
--> $DIR/issue-54348.rs:4:5
|
LL | [1][1u64 as usize]; // ERROR index out of bounds
| ^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors

View file

@ -0,0 +1,5 @@
use std::path::Path;
fn main() {
let Path::new(); //~ ERROR expected tuple struct/variant
}

View file

@ -0,0 +1,9 @@
error[E0164]: expected tuple struct/variant, found method `<Path>::new`
--> $DIR/issue-55587.rs:4:9
|
LL | let Path::new(); //~ ERROR expected tuple struct/variant
| ^^^^^^^^^^^ not a tuple variant or struct
error: aborting due to previous error
For more information about this error, try `rustc --explain E0164`.