storage_live: avoid computing the layout unless necessary
This commit is contained in:
parent
f87e91de7d
commit
6d1ce9bd13
3 changed files with 69 additions and 18 deletions
|
|
@ -1,6 +1,6 @@
|
|||
//@ignore-32bit
|
||||
|
||||
fn main() {
|
||||
let _fat: [u8; (1 << 61) + (1 << 31)]; //~ ERROR: post-monomorphization error
|
||||
_fat = [0; (1u64 << 61) as usize + (1u64 << 31) as usize];
|
||||
let _fat: [u8; (1 << 61) + (1 << 31)]; // ideally we'd error here, but we avoid computing the layout until absolutely necessary
|
||||
_fat = [0; (1u64 << 61) as usize + (1u64 << 31) as usize]; //~ ERROR: post-monomorphization error
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error: post-monomorphization error: values of the type `[u8; 2305843011361177600]` are too big for the current architecture
|
||||
--> $DIR/type-too-large.rs:LL:CC
|
||||
|
|
||||
LL | let _fat: [u8; (1 << 61) + (1 << 31)];
|
||||
| ^^^^ values of the type `[u8; 2305843011361177600]` are too big for the current architecture
|
||||
LL | _fat = [0; (1u64 << 61) as usize + (1u64 << 31) as usize];
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ values of the type `[u8; 2305843011361177600]` are too big for the current architecture
|
||||
|
|
||||
= note: inside `main` at $DIR/type-too-large.rs:LL:CC
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue