forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#124516 - oli-obk:taint_const_eval, r=RalfJung
Allow monomorphization time const eval failures if the cause is a type layout issue r? `@RalfJung` fixes rust-lang#124348
- Loading branch information
Showing
8 changed files
with
76 additions
and
14 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.
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 @@ | ||
//! ICE test #124348 | ||
//! We should not be running const eval if the layout has errors. | ||
|
||
enum Eek { | ||
TheConst, | ||
UnusedByTheConst(Sum), | ||
//~^ ERROR cannot find type `Sum` in this scope | ||
} | ||
|
||
const EEK_ZERO: &[Eek] = &[]; | ||
|
||
fn main() {} |
14 changes: 14 additions & 0 deletions
14
tests/ui/consts/erroneous_type_in_const_return_value.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,14 @@ | ||
error[E0412]: cannot find type `Sum` in this scope | ||
--> $DIR/erroneous_type_in_const_return_value.rs:6:22 | ||
| | ||
LL | UnusedByTheConst(Sum), | ||
| ^^^ not found in this scope | ||
| | ||
help: consider importing this trait | ||
| | ||
LL + use std::iter::Sum; | ||
| | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0412`. |
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,14 @@ | ||
//! ICE test #124348 | ||
//! We should not be running const eval if the layout has errors. | ||
|
||
enum Eek { | ||
TheConst, | ||
UnusedByTheConst(Sum), | ||
//~^ ERROR cannot find type `Sum` in this scope | ||
} | ||
|
||
const fn foo() { | ||
let x: &'static [Eek] = &[]; | ||
} | ||
|
||
fn main() {} |
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,14 @@ | ||
error[E0412]: cannot find type `Sum` in this scope | ||
--> $DIR/erroneous_type_in_promoted.rs:6:22 | ||
| | ||
LL | UnusedByTheConst(Sum), | ||
| ^^^ not found in this scope | ||
| | ||
help: consider importing this trait | ||
| | ||
LL + use std::iter::Sum; | ||
| | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0412`. |