]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/large_const_alloc.rs
Rollup merge of #106717 - klensy:typo, r=lcnr
[rust.git] / tests / ui / consts / large_const_alloc.rs
1 // only-64bit
2 // on 32bit and 16bit platforms it is plausible that the maximum allocation size will succeed
3
4 const FOO: () = {
5     // 128 TiB, unlikely anyone has that much RAM
6     let x = [0_u8; (1 << 47) - 1];
7     //~^ ERROR evaluation of constant value failed
8 };
9
10 static FOO2: () = {
11     let x = [0_u8; (1 << 47) - 1];
12     //~^ ERROR could not evaluate static initializer
13 };
14
15 fn main() {
16     let _ = FOO;
17     let _ = FOO2;
18 }