Skip to content

Commit

Permalink
Rollup merge of rust-lang#55956 - euclio:issue-55587, r=estebank
Browse files Browse the repository at this point in the history
add tests for some fixed ICEs

Fixes rust-lang#55587.
Fixes rust-lang#54348.

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

r? @estebank
  • Loading branch information
pietroalbini authored Nov 15, 2018
2 parents f40f04b + e2ef0f7 commit d0e08ce
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/test/ui/issues/issue-54348.rs
Original file line number Diff line number Diff line change
@@ -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
}
16 changes: 16 additions & 0 deletions src/test/ui/issues/issue-54348.stderr
Original file line number Diff line number Diff line change
@@ -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

5 changes: 5 additions & 0 deletions src/test/ui/issues/issue-55587.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
use std::path::Path;

fn main() {
let Path::new(); //~ ERROR expected tuple struct/variant
}
9 changes: 9 additions & 0 deletions src/test/ui/issues/issue-55587.stderr
Original file line number Diff line number Diff line change
@@ -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`.

0 comments on commit d0e08ce

Please sign in to comment.