Skip to content

Commit 03f9b0b

Browse files
committed
Add test for #114912
1 parent ac9707d commit 03f9b0b

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// check-fail
2+
// edition:2021
3+
4+
// test for issue-114912 - debug ice: attempted to add with overflow
5+
6+
async fn main() {
7+
//~^ ERROR E0752
8+
[0usize; 0xffff_ffff_ffff_ffff].await;
9+
//~^ ERROR E0277
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
error[E0277]: `[usize; usize::MAX]` is not a future
2+
--> $DIR/debug-ice-attempted-to-add-with-overflow.rs:8:37
3+
|
4+
LL | [0usize; 0xffff_ffff_ffff_ffff].await;
5+
| -^^^^^
6+
| ||
7+
| |`[usize; usize::MAX]` is not a future
8+
| help: remove the `.await`
9+
|
10+
= help: the trait `Future` is not implemented for `[usize; usize::MAX]`
11+
= note: [usize; usize::MAX] must be a future or must implement `IntoFuture` to be awaited
12+
= note: required for `[usize; usize::MAX]` to implement `IntoFuture`
13+
14+
error[E0752]: `main` function is not allowed to be `async`
15+
--> $DIR/debug-ice-attempted-to-add-with-overflow.rs:6:1
16+
|
17+
LL | async fn main() {
18+
| ^^^^^^^^^^^^^^^ `main` function is not allowed to be `async`
19+
20+
error: aborting due to 2 previous errors
21+
22+
Some errors have detailed explanations: E0277, E0752.
23+
For more information about an error, try `rustc --explain E0277`.

0 commit comments

Comments
 (0)