mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
Test memory exhaustion in const evaluation
This commit is contained in:
parent
3e735a52fe
commit
a59fafeb13
@ -7,6 +7,12 @@ const FOO: () = {
|
||||
//~^ ERROR evaluation of constant value failed
|
||||
};
|
||||
|
||||
static FOO2: () = {
|
||||
let x = [0_u8; (1 << 47) - 1];
|
||||
//~^ ERROR could not evaluate static initializer
|
||||
};
|
||||
|
||||
fn main() {
|
||||
let _ = FOO;
|
||||
let _ = FOO2;
|
||||
}
|
||||
|
@ -4,6 +4,12 @@ error[E0080]: evaluation of constant value failed
|
||||
LL | let x = [0_u8; (1 << 47) - 1];
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ tried to allocate more memory than available to compiler
|
||||
|
||||
error: aborting due to previous error
|
||||
error[E0080]: could not evaluate static initializer
|
||||
--> $DIR/large_const_alloc.rs:11:13
|
||||
|
|
||||
LL | let x = [0_u8; (1 << 47) - 1];
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ tried to allocate more memory than available to compiler
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0080`.
|
||||
|
Loading…
Reference in New Issue
Block a user