-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bad printing of const-eval queries
- Loading branch information
Showing
5 changed files
with
52 additions
and
3 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 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,20 @@ | ||
// compile-flags: -Ztreat-err-as-bug | ||
// build-fail | ||
// failure-status: 101 | ||
// normalize-stderr-test "\nerror: internal compiler error.*\n\n" -> "" | ||
// normalize-stderr-test "note:.*unexpectedly panicked.*\n\n" -> "" | ||
// normalize-stderr-test "note: we would appreciate a bug report.*\n\n" -> "" | ||
// normalize-stderr-test "note: compiler flags.*\n\n" -> "" | ||
// normalize-stderr-test "note: rustc.*running on.*\n\n" -> "" | ||
// normalize-stderr-test "thread.*panicked.*\n" -> "" | ||
// normalize-stderr-test "stack backtrace:\n" -> "" | ||
// normalize-stderr-test " \d{1,}: .*\n" -> "" | ||
// normalize-stderr-test ".*note: Some details.*\n" -> "" | ||
|
||
#![allow(unconditional_panic)] | ||
|
||
fn main() { | ||
let x: &'static i32 = &(1 / 0); | ||
//~^ ERROR reaching this expression at runtime will panic or abort [const_err] | ||
println!("x={}", x); | ||
} |
18 changes: 18 additions & 0 deletions
18
src/test/ui/consts/const-eval/const-eval-query-stack.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,18 @@ | ||
error: reaching this expression at runtime will panic or abort | ||
--> $DIR/const-eval-query-stack.rs:17:28 | ||
| | ||
LL | let x: &'static i32 = &(1 / 0); | ||
| -^^^^^^^ | ||
| | | ||
| dividing by zero | ||
| | ||
= note: `#[deny(const_err)]` on by default | ||
|
||
query stack during panic: | ||
#0 [const_eval_raw] const-evaluating `main::promoted[1]` | ||
#1 [const_eval_validated] const-evaluating + checking `main::promoted[1]` | ||
#2 [const_eval_validated] const-evaluating + checking `main::promoted[1]` | ||
#3 [normalize_generic_arg_after_erasing_regions] normalizing `main::promoted[1]` | ||
#4 [optimized_mir] optimizing MIR for `main` | ||
#5 [collect_and_partition_mono_items] collect_and_partition_mono_items | ||
end of query stack |