File tree Expand file tree Collapse file tree 3 files changed +7
-16
lines changed
compiler/rustc_middle/src/mir/interpret Expand file tree Collapse file tree 3 files changed +7
-16
lines changed Original file line number Diff line number Diff line change @@ -530,7 +530,8 @@ impl InterpError<'_> {
530530 use InterpError :: * ;
531531 match * self {
532532 MachineStop ( ref err) => err. is_hard_err ( ) ,
533- InterpError :: UndefinedBehavior ( _) => true ,
533+ UndefinedBehavior ( _) => true ,
534+ ResourceExhaustion ( ResourceExhaustionInfo :: MemoryExhausted ) => true ,
534535 _ => false ,
535536 }
536537 }
Original file line number Diff line number Diff line change 44const FOO : ( ) = {
55 // 128 TiB, unlikely anyone has that much RAM
66 let x = [ 0_u8 ; ( 1 << 47 ) - 1 ] ;
7- //~^ ERROR any use of this value will cause an error
8- //~| WARNING this was previously accepted by the compiler but is being phased out
7+ //~^ ERROR evaluation of constant value failed
98} ;
109
1110fn main ( ) {
Original file line number Diff line number Diff line change 1- error: any use of this value will cause an error
1+ error[E0080]: evaluation of constant value failed
22 --> $DIR/large_const_alloc.rs:6:13
33 |
4- LL | / const FOO: () = {
5- LL | | // 128 TiB, unlikely anyone has that much RAM
6- LL | | let x = [0_u8; (1 << 47) - 1];
7- | | ^^^^^^^^^^^^^^^^^^^^^ tried to allocate more memory than available to compiler
8- LL | |
9- LL | |
10- LL | | };
11- | |__-
12- |
13- = note: `#[deny(const_err)]` on by default
14- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
15- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
4+ LL | let x = [0_u8; (1 << 47) - 1];
5+ | ^^^^^^^^^^^^^^^^^^^^^ tried to allocate more memory than available to compiler
166
177error: aborting due to previous error
188
9+ For more information about this error, try `rustc --explain E0080`.
You can’t perform that action at this time.
0 commit comments