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<'_> {
530
530
use InterpError :: * ;
531
531
match * self {
532
532
MachineStop ( ref err) => err. is_hard_err ( ) ,
533
- InterpError :: UndefinedBehavior ( _) => true ,
533
+ UndefinedBehavior ( _) => true ,
534
+ ResourceExhaustion ( ResourceExhaustionInfo :: MemoryExhausted ) => true ,
534
535
_ => false ,
535
536
}
536
537
}
Original file line number Diff line number Diff line change 4
4
const FOO : ( ) = {
5
5
// 128 TiB, unlikely anyone has that much RAM
6
6
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
9
8
} ;
10
9
11
10
fn 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
2
2
--> $DIR/large_const_alloc.rs:6:13
3
3
|
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
16
6
17
7
error: aborting due to previous error
18
8
9
+ For more information about this error, try `rustc --explain E0080`.
You can’t perform that action at this time.
0 commit comments