-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
static eval: Do not ICE on layout size overflow
Layout size overflow and typeck eval errors are reported. Trigger a bug only when the eval error is strictly labeled as TooGeneric.
- Loading branch information
1 parent
a8a2a88
commit e7e17f9
Showing
3 changed files
with
30 additions
and
4 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,18 @@ | ||
// only-x86_64 | ||
const HUGE_SIZE: usize = !0usize / 8; | ||
|
||
|
||
pub struct TooBigArray { | ||
arr: [u8; HUGE_SIZE], | ||
} | ||
|
||
impl TooBigArray { | ||
pub const fn new() -> Self { | ||
TooBigArray { arr: [0x00; HUGE_SIZE], } | ||
} | ||
} | ||
|
||
static MY_TOO_BIG_ARRAY_1: TooBigArray = TooBigArray::new(); | ||
static MY_TOO_BIG_ARRAY_2: [u8; HUGE_SIZE] = [0x00; HUGE_SIZE]; | ||
|
||
fn main() { } |
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,4 @@ | ||
error: the type `[u8; 2305843009213693951]` is too big for the current architecture | ||
|
||
error: aborting due to previous error | ||
|