Skip to content

Commit 3b2ff90

Browse files
committed
Add ui test for const evaluation fail when type is too big.
1 parent 42b4b9c commit 3b2ff90

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

Diff for: tests/ui/consts/const-eval-fail-too-big.rs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//Error output test for #78834: Type is too big for the target architecture
2+
struct B<
3+
A: Sized = [(); {
4+
let x = [0u8; !0usize];
5+
//~^ ERROR evaluation of constant value failed
6+
1
7+
}],
8+
> {
9+
a: A,
10+
}
11+
12+
fn main() {}

Diff for: tests/ui/consts/const-eval-fail-too-big.stderr

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0080]: evaluation of constant value failed
2+
--> $DIR/const-eval-fail-too-big.rs:4:28
3+
|
4+
LL | let x = [0u8; !0usize];
5+
| ^^^^^^^^^^^^^^ values of the type `[u8; usize::MAX]` are too big for the target architecture
6+
7+
error: aborting due to 1 previous error
8+
9+
For more information about this error, try `rustc --explain E0080`.

0 commit comments

Comments
 (0)