File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,12 @@ const FOO: () = {
77 //~^ ERROR evaluation of constant value failed
88} ;
99
10+ static FOO2 : ( ) = {
11+ let x = [ 0_u8 ; ( 1 << 47 ) - 1 ] ;
12+ //~^ ERROR could not evaluate static initializer
13+ } ;
14+
1015fn main ( ) {
1116 let _ = FOO ;
17+ let _ = FOO2 ;
1218}
Original file line number Diff line number Diff line change @@ -4,6 +4,12 @@ error[E0080]: evaluation of constant value failed
44LL | let x = [0_u8; (1 << 47) - 1];
55 | ^^^^^^^^^^^^^^^^^^^^^ tried to allocate more memory than available to compiler
66
7- error: aborting due to previous error
7+ error[E0080]: could not evaluate static initializer
8+ --> $DIR/large_const_alloc.rs:11:13
9+ |
10+ LL | let x = [0_u8; (1 << 47) - 1];
11+ | ^^^^^^^^^^^^^^^^^^^^^ tried to allocate more memory than available to compiler
12+
13+ error: aborting due to 2 previous errors
814
915For more information about this error, try `rustc --explain E0080`.
You can’t perform that action at this time.
0 commit comments