forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#55792 - oli-obk:propsicle, r=RalfJung
Prevent ICE in const-prop array oob check fixes rust-lang#55772 fixes rust-lang#54541
- Loading branch information
Showing
5 changed files
with
36 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fn main() { | ||
[0; 3][3u64 as usize]; //~ ERROR the len is 3 but the index is 3 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
error: index out of bounds: the len is 3 but the index is 3 | ||
--> $DIR/const-prop-ice.rs:2:5 | ||
| | ||
LL | [0; 3][3u64 as usize]; //~ ERROR the len is 3 but the index is 3 | ||
| ^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: #[deny(const_err)] on by default | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|