diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
commit | 698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch) | |
tree | 173a775858bd501c378080a10dca74132f05bc50 /src/test/ui/treat-err-as-bug | |
parent | Initial commit. (diff) | |
download | rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip |
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/treat-err-as-bug')
-rw-r--r-- | src/test/ui/treat-err-as-bug/delay_span_bug.rs | 12 | ||||
-rw-r--r-- | src/test/ui/treat-err-as-bug/delay_span_bug.stderr | 11 | ||||
-rw-r--r-- | src/test/ui/treat-err-as-bug/err.rs | 12 | ||||
-rw-r--r-- | src/test/ui/treat-err-as-bug/err.stderr | 12 |
4 files changed, 47 insertions, 0 deletions
diff --git a/src/test/ui/treat-err-as-bug/delay_span_bug.rs b/src/test/ui/treat-err-as-bug/delay_span_bug.rs new file mode 100644 index 000000000..d4d44049c --- /dev/null +++ b/src/test/ui/treat-err-as-bug/delay_span_bug.rs @@ -0,0 +1,12 @@ +// 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" -> "" +// rustc-env:RUST_BACKTRACE=0 + +#![feature(rustc_attrs)] + +#[rustc_error(delay_span_bug_from_inside_query)] +fn main() {} diff --git a/src/test/ui/treat-err-as-bug/delay_span_bug.stderr b/src/test/ui/treat-err-as-bug/delay_span_bug.stderr new file mode 100644 index 000000000..c23c2b81b --- /dev/null +++ b/src/test/ui/treat-err-as-bug/delay_span_bug.stderr @@ -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:12: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 diff --git a/src/test/ui/treat-err-as-bug/err.rs b/src/test/ui/treat-err-as-bug/err.rs new file mode 100644 index 000000000..de3e9ed6c --- /dev/null +++ b/src/test/ui/treat-err-as-bug/err.rs @@ -0,0 +1,12 @@ +// 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" -> "" +// rustc-env:RUST_BACKTRACE=0 + +#![crate_type = "rlib"] + +pub static C: u32 = 0 - 1; +//~^ ERROR could not evaluate static initializer diff --git a/src/test/ui/treat-err-as-bug/err.stderr b/src/test/ui/treat-err-as-bug/err.stderr new file mode 100644 index 000000000..8f67571c2 --- /dev/null +++ b/src/test/ui/treat-err-as-bug/err.stderr @@ -0,0 +1,12 @@ +error[E0080]: could not evaluate static initializer + --> $DIR/err.rs:11: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 |