Skip to content

Commit

Permalink
Rollup merge of #55956 - euclio:issue-55587, r=estebank
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kennytm committed Nov 15, 2018
2 parents 6151db4 + e2ef0f7 commit cdfa41e
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 cdfa41e

Please sign in to comment.