Skip to content

Commit cdfa41e

Browse files
committed
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.
2 parents 6151db4 + e2ef0f7 commit cdfa41e

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed

src/test/ui/issues/issue-54348.rs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fn main() {
2+
[1][0u64 as usize];
3+
[1][1.5 as usize]; // ERROR index out of bounds
4+
[1][1u64 as usize]; // ERROR index out of bounds
5+
}

src/test/ui/issues/issue-54348.stderr

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
error: index out of bounds: the len is 1 but the index is 1
2+
--> $DIR/issue-54348.rs:3:5
3+
|
4+
LL | [1][1.5 as usize]; // ERROR index out of bounds
5+
| ^^^^^^^^^^^^^^^^^
6+
|
7+
= note: #[deny(const_err)] on by default
8+
9+
error: index out of bounds: the len is 1 but the index is 1
10+
--> $DIR/issue-54348.rs:4:5
11+
|
12+
LL | [1][1u64 as usize]; // ERROR index out of bounds
13+
| ^^^^^^^^^^^^^^^^^^
14+
15+
error: aborting due to 2 previous errors
16+

src/test/ui/issues/issue-55587.rs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
use std::path::Path;
2+
3+
fn main() {
4+
let Path::new(); //~ ERROR expected tuple struct/variant
5+
}

src/test/ui/issues/issue-55587.stderr

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

0 commit comments

Comments
 (0)