forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
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#120616 - fmease:fix-ice-const-eval-fail-undef-field-access, r=compiler-errors Fix ICE on field access on a tainted type after const-eval failure Fixes rust-lang#120615. r? oli-obk or compiler
- Loading branch information
Showing
3 changed files
with
27 additions
and
1 deletion.
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
5 changes: 5 additions & 0 deletions
5
tests/ui/consts/const-eval/field-access-after-const-eval-fail-in-ty.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,5 @@ | ||
// Regression test for issue #120615. | ||
|
||
fn main() { | ||
[(); loop {}].field; //~ ERROR constant evaluation is taking a long time | ||
} |
17 changes: 17 additions & 0 deletions
17
tests/ui/consts/const-eval/field-access-after-const-eval-fail-in-ty.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,17 @@ | ||
error: constant evaluation is taking a long time | ||
--> $DIR/field-access-after-const-eval-fail-in-ty.rs:4:10 | ||
| | ||
LL | [(); loop {}].field; | ||
| ^^^^^^^ | ||
| | ||
= note: this lint makes sure the compiler doesn't get stuck due to infinite loops in const eval. | ||
If your compilation actually takes a long time, you can safely allow the lint. | ||
help: the constant being evaluated | ||
--> $DIR/field-access-after-const-eval-fail-in-ty.rs:4:10 | ||
| | ||
LL | [(); loop {}].field; | ||
| ^^^^^^^ | ||
= note: `#[deny(long_running_const_eval)]` on by default | ||
|
||
error: aborting due to 1 previous error | ||
|