Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions tests/ui/consts/const-eval-fail-too-big.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//Error output test for #78834: Type is too big for the target architecture
struct B<
A: Sized = [(); {
let x = [0u8; !0usize];
//~^ ERROR evaluation of constant value failed
1
}],
> {
a: A,
}

fn main() {}
9 changes: 9 additions & 0 deletions tests/ui/consts/const-eval-fail-too-big.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error[E0080]: evaluation of constant value failed
--> $DIR/const-eval-fail-too-big.rs:4:28
|
LL | let x = [0u8; !0usize];
| ^^^^^^^^^^^^^^ values of the type `[u8; usize::MAX]` are too big for the target architecture

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0080`.
Loading