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: () = {
7
7
//~^ ERROR evaluation of constant value failed
8
8
} ;
9
9
10
+ static FOO2 : ( ) = {
11
+ let x = [ 0_u8 ; ( 1 << 47 ) - 1 ] ;
12
+ //~^ ERROR could not evaluate static initializer
13
+ } ;
14
+
10
15
fn main ( ) {
11
16
let _ = FOO ;
17
+ let _ = FOO2 ;
12
18
}
Original file line number Diff line number Diff line change @@ -4,6 +4,12 @@ error[E0080]: evaluation of constant value failed
4
4
LL | let x = [0_u8; (1 << 47) - 1];
5
5
| ^^^^^^^^^^^^^^^^^^^^^ tried to allocate more memory than available to compiler
6
6
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
8
14
9
15
For more information about this error, try `rustc --explain E0080`.
You can’t perform that action at this time.
0 commit comments