-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
interpret: do not ICE when a promoted fails with OOM
- Loading branch information
Showing
6 changed files
with
51 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
tests/ui/consts/promoted_running_out_of_memory_issue-130687.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//! Ensure we do not ICE when a promoted fails to evaluate due to running out of memory. | ||
//! Also see <https://github.com/rust-lang/rust/issues/130687>. | ||
// Needs the max type size to be much bigger than the RAM people typically have. | ||
//@ only-64bit | ||
|
||
pub struct Data([u8; (1 << 47) - 1]); | ||
const _: &'static Data = &Data([0; (1 << 47) - 1]); | ||
//~^ERROR: evaluation of constant value failed | ||
//~| tried to allocate more memory than available to compiler | ||
|
||
fn main() {} |
15 changes: 15 additions & 0 deletions
15
tests/ui/consts/promoted_running_out_of_memory_issue-130687.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
error[E0080]: evaluation of constant value failed | ||
--> $DIR/promoted_running_out_of_memory_issue-130687.rs:8:32 | ||
| | ||
LL | const _: &'static Data = &Data([0; (1 << 47) - 1]); | ||
| ^^^^^^^^^^^^^^^^^^ tried to allocate more memory than available to compiler | ||
|
||
note: erroneous constant encountered | ||
--> $DIR/promoted_running_out_of_memory_issue-130687.rs:8:26 | ||
| | ||
LL | const _: &'static Data = &Data([0; (1 << 47) - 1]); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0080`. |