Rollup merge of #71531 - spastorino:move-treat-err-as-bug-tests-to-ui, r=oli-obk
Move treat err as bug tests to ui cc `@oli-obk`
This commit is contained in:
commit
35ebbe3e01
7 changed files with 45 additions and 14 deletions
|
@ -1,7 +0,0 @@
|
|||
-include ../tools.mk
|
||||
|
||||
all:
|
||||
$(RUSTC) err.rs -Z treat-err-as-bug 2>&1 \
|
||||
| $(CGREP) "panicked at 'aborting due to \`-Z treat-err-as-bug=1\`'"
|
||||
$(RUSTC) delay_span_bug.rs -Z treat-err-as-bug 2>&1 \
|
||||
| $(CGREP) "panicked at 'aborting due to \`-Z treat-err-as-bug=1\`'"
|
|
@ -1,4 +0,0 @@
|
|||
#![feature(rustc_attrs)]
|
||||
|
||||
#[rustc_error(delay_span_bug_from_inside_query)]
|
||||
fn main() {}
|
|
@ -1,3 +0,0 @@
|
|||
#![crate_type="rlib"]
|
||||
|
||||
pub static C: u32 = 0-1;
|
11
src/test/ui/treat-err-as-bug/delay_span_bug.rs
Normal file
11
src/test/ui/treat-err-as-bug/delay_span_bug.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
// compile-flags: -Ztreat-err-as-bug
|
||||
// failure-status: 101
|
||||
// error-pattern: aborting due to `-Z treat-err-as-bug=1`
|
||||
// error-pattern: [trigger_delay_span_bug] trigger a delay span bug
|
||||
// normalize-stderr-test "note: .*\n\n" -> ""
|
||||
// normalize-stderr-test "thread 'rustc' panicked.*\n" -> ""
|
||||
|
||||
#![feature(rustc_attrs)]
|
||||
|
||||
#[rustc_error(delay_span_bug_from_inside_query)]
|
||||
fn main() {}
|
11
src/test/ui/treat-err-as-bug/delay_span_bug.stderr
Normal file
11
src/test/ui/treat-err-as-bug/delay_span_bug.stderr
Normal file
|
@ -0,0 +1,11 @@
|
|||
error: internal compiler error: delayed span bug triggered by #[rustc_error(delay_span_bug_from_inside_query)]
|
||||
--> $DIR/delay_span_bug.rs:11:1
|
||||
|
|
||||
LL | fn main() {}
|
||||
| ^^^^^^^^^
|
||||
|
||||
error: internal compiler error: unexpected panic
|
||||
|
||||
query stack during panic:
|
||||
#0 [trigger_delay_span_bug] trigger a delay span bug
|
||||
end of query stack
|
11
src/test/ui/treat-err-as-bug/err.rs
Normal file
11
src/test/ui/treat-err-as-bug/err.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
// compile-flags: -Ztreat-err-as-bug
|
||||
// failure-status: 101
|
||||
// error-pattern: aborting due to `-Z treat-err-as-bug=1`
|
||||
// error-pattern: [eval_to_allocation_raw] const-evaluating + checking `C`
|
||||
// normalize-stderr-test "note: .*\n\n" -> ""
|
||||
// normalize-stderr-test "thread 'rustc' panicked.*\n" -> ""
|
||||
|
||||
#![crate_type = "rlib"]
|
||||
|
||||
pub static C: u32 = 0 - 1;
|
||||
//~^ ERROR could not evaluate static initializer
|
12
src/test/ui/treat-err-as-bug/err.stderr
Normal file
12
src/test/ui/treat-err-as-bug/err.stderr
Normal file
|
@ -0,0 +1,12 @@
|
|||
error[E0080]: could not evaluate static initializer
|
||||
--> $DIR/err.rs:10:21
|
||||
|
|
||||
LL | pub static C: u32 = 0 - 1;
|
||||
| ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
|
||||
|
||||
error: internal compiler error: unexpected panic
|
||||
|
||||
query stack during panic:
|
||||
#0 [eval_to_allocation_raw] const-evaluating + checking `C`
|
||||
#1 [eval_to_allocation_raw] const-evaluating + checking `C`
|
||||
end of query stack
|
Loading…
Reference in a new issue