Skip to content

Commit 3de0d67

Browse files
authored
Rollup merge of #102134 - flba-eb:master, r=bjorn3
Detect panic strategy using `rustc --print cfg` Instead of relying on a command line parameter, detect if a target is able to unwind or not. Ignore tests that require unwinding on targets that don't support it. I did not find any place where the removed parameter has been used, but it feels a bit risky as I'm new to this test framework. r? bjorn3
2 parents 6b001f3 + ccd19c7 commit 3de0d67

File tree

56 files changed

+23
-78
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+23
-78
lines changed

src/test/ui/async-await/async-fn-size-moved-locals.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//
88
// See issue #59123 for a full explanation.
99

10-
// ignore-emscripten (sizes don't match)
1110
// needs-unwind Size of Futures change on panic=abort
1211
// run-pass
1312

src/test/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-panic.rs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// error-pattern: thread 'main' panicked at '`async fn` resumed after panicking'
77
// edition:2018
88
// ignore-wasm no panic or subprocess support
9-
// ignore-emscripten no panic or subprocess support
109

1110
#![feature(generators, generator_trait)]
1211

src/test/ui/binding/fn-arg-incomplete-pattern-drop-order.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// Check that partially moved from function parameters are dropped after the
44
// named bindings that move from them.
55

6-
// ignore-wasm32-bare compiled with panic=abort by default
76

87
use std::{panic, cell::RefCell};
98

src/test/ui/builtin-clone-unwind.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#![allow(unused_variables)]
55
#![allow(unused_imports)]
6-
// ignore-wasm32-bare compiled with panic=abort by default
76

87
// Test that builtin implementations of `Clone` cleanup everything
98
// in case of unwinding.

src/test/ui/catch-unwind-bang.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
// needs-unwind
3-
// ignore-wasm32-bare compiled with panic=abort by default
43

54
fn worker() -> ! {
65
panic!()

src/test/ui/cfg/cfg-panic.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// build-pass
22
// compile-flags: -C panic=unwind
33
// needs-unwind
4-
// ignore-emscripten no panic_unwind implementation
5-
// ignore-wasm32 no panic_unwind implementation
6-
// ignore-wasm64 no panic_unwind implementation
74

85

96
#[cfg(panic = "abort")]

src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#![deny(rust_2021_incompatible_closure_captures)]
55
//~^ NOTE: the lint level is defined here
6-
// ignore-wasm32-bare compiled with panic=abort by default
76
#![feature(fn_traits)]
87
#![feature(never_type)]
98

src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#![deny(rust_2021_incompatible_closure_captures)]
55
//~^ NOTE: the lint level is defined here
6-
// ignore-wasm32-bare compiled with panic=abort by default
76
#![feature(fn_traits)]
87
#![feature(never_type)]
98

src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: changes to closure capture in Rust 2021 will affect which traits the closure implements
2-
--> $DIR/mir_calls_to_shims.rs:21:38
2+
--> $DIR/mir_calls_to_shims.rs:20:38
33
|
44
LL | let result = panic::catch_unwind(move || {
55
| ^^^^^^^

src/test/ui/drop/dynamic-drop-async.rs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// run-pass
77
// needs-unwind
88
// edition:2018
9-
// ignore-wasm32-bare compiled with panic=abort by default
109

1110
#![allow(unused)]
1211

src/test/ui/drop/dynamic-drop.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
// needs-unwind
3-
// ignore-wasm32-bare compiled with panic=abort by default
43

54
#![feature(generators, generator_trait)]
65

src/test/ui/drop/repeat-drop.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// run-pass
22
// needs-unwind
3-
// ignore-wasm32-bare no unwinding panic
4-
// ignore-avr no unwinding panic
5-
// ignore-nvptx64 no unwinding panic
63

74
static mut CHECK: usize = 0;
85

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// compile-flags: --extern std=
22
// error-pattern: extern location for std does not exist
33
// needs-unwind since it affects the error output
4-
// ignore-emscripten compiled with panic=abort, personality not required
4+
// ignore-emscripten missing eh_catch_typeinfo lang item
55

66
fn main() {}

src/test/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
// needs-unwind
3-
// ignore-wasm32-bare compiled with panic=abort by default
43
// ignore-emscripten no threads support
54

65
// rust-lang/rust#64655: with panic=unwind, a panic from a subroutine

src/test/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
// needs-unwind
3-
// ignore-wasm32-bare compiled with panic=abort by default
43
// ignore-emscripten no threads support
54

65
// rust-lang/rust#64655: with panic=unwind, a panic from a subroutine

src/test/ui/generator/panic-drops-resume.rs

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
33
// run-pass
44
// needs-unwind
5-
// ignore-wasm no unwind support
6-
// ignore-emscripten no unwind support
75

86
#![feature(generators, generator_trait)]
97

src/test/ui/generator/panic-drops.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run-pass
22
// needs-unwind
33

4-
// ignore-wasm32-bare compiled with panic=abort by default
54

65
#![feature(generators, generator_trait)]
76

src/test/ui/generator/panic-safe.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run-pass
22
// needs-unwind
33

4-
// ignore-wasm32-bare compiled with panic=abort by default
54

65
#![feature(generators, generator_trait)]
76

src/test/ui/generator/resume-after-return.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run-pass
22
// needs-unwind
33

4-
// ignore-wasm32-bare compiled with panic=abort by default
54

65
#![feature(generators, generator_trait)]
76

src/test/ui/intrinsics/panic-uninitialized-zeroed.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
// needs-unwind
3-
// ignore-wasm32-bare compiled with panic=abort by default
43
// revisions: mir thir strict
54
// [thir]compile-flags: -Zthir-unsafeck
65
// [strict]compile-flags: -Zstrict-init-checks

src/test/ui/issues/issue-14875.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
// needs-unwind
3-
// ignore-wasm32-bare compiled with panic=abort by default
43

54
// Check that values are not leaked when a dtor panics (#14875)
65

src/test/ui/issues/issue-29948.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
// needs-unwind
3-
// ignore-wasm32-bare compiled with panic=abort by default
43

54
use std::panic;
65

src/test/ui/issues/issue-43853.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
// needs-unwind
3-
// ignore-wasm32-bare compiled with panic=abort by default
43

54
use std::panic;
65

src/test/ui/issues/issue-46519.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// compile-flags:--test -O
33

44
// needs-unwind
5-
// ignore-wasm32-bare compiled with panic=abort by default
65

76
#[test]
87
#[should_panic(expected = "creating inhabited type")]

src/test/ui/iterators/iter-count-overflow-debug.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run-pass
22
// only-32bit too impatient for 2⁶⁴ items
33
// needs-unwind
4-
// ignore-wasm32-bare compiled with panic=abort by default
54
// compile-flags: -C debug_assertions=yes -C opt-level=3
65

76
use std::panic;

src/test/ui/iterators/iter-position-overflow-debug.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run-pass
22
// only-32bit too impatient for 2⁶⁴ items
33
// needs-unwind
4-
// ignore-wasm32-bare compiled with panic=abort by default
54
// compile-flags: -C debug_assertions=yes -C opt-level=3
65

76
use std::panic;

src/test/ui/iterators/iter-step-overflow-debug.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
// needs-unwind
3-
// ignore-wasm32-bare compiled with panic=abort by default
43
// compile-flags: -C debug_assertions=yes
54

65
use std::panic;

src/test/ui/iterators/iter-sum-overflow-debug.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
// needs-unwind
3-
// ignore-wasm32-bare compiled with panic=abort by default
43
// compile-flags: -C debug_assertions=yes
54

65
use std::panic;

src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
// needs-unwind
3-
// ignore-wasm32-bare compiled with panic=abort by default
43
// compile-flags: -C overflow-checks
54

65
use std::panic;

src/test/ui/macros/macro-comma-behavior-rpass.rs

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
// compile-flags: --test -C debug_assertions=yes
1515
// revisions: std core
1616

17-
// ignore-wasm32-bare compiled with panic=abort by default
1817
#![cfg_attr(core, no_std)]
1918

2019
#[cfg(core)]

src/test/ui/mir/mir_calls_to_shims.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
// needs-unwind
3-
// ignore-wasm32-bare compiled with panic=abort by default
43

54
#![feature(fn_traits)]
65
#![feature(never_type)]

src/test/ui/mir/mir_codegen_calls_diverging_drops.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run-fail
22
// error-pattern:diverging_fn called
33
// error-pattern:0 dropped
4-
// ignore-emscripten no processes
54
// needs-unwind this test checks that a destructor is called after panicking
65

76
struct Droppable(u8);

src/test/ui/mir/mir_drop_order.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
// needs-unwind
3-
// ignore-wasm32-bare compiled with panic=abort by default
43

54
use std::cell::RefCell;
65
use std::panic;

src/test/ui/mir/mir_drop_panics.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// needs-unwind
33
// error-pattern:panic 1
44
// error-pattern:drop 2
5-
// ignore-emscripten no processes
65

76
struct Droppable(u32);
87
impl Drop for Droppable {

src/test/ui/mir/mir_let_chains_drop_order.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
// needs-unwind
3-
// ignore-wasm32-bare compiled with panic=abort by default
43

54
// See `mir_drop_order.rs` for more information
65

src/test/ui/numbers-arithmetic/next-power-of-two-overflow-debug.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run-pass
22
// compile-flags: -C debug_assertions=yes
33
// needs-unwind
4-
// ignore-wasm32-bare compiled with panic=abort by default
54
// ignore-emscripten dies with an LLVM error
65

76
use std::panic;

src/test/ui/panic-handler/weak-lang-item.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// error-pattern: `#[panic_handler]` function required, but not found
33
// error-pattern: language item required, but not found: `eh_personality`
44
// needs-unwind since it affects the error output
5-
// ignore-emscripten compiled with panic=abort, personality not required
5+
// ignore-emscripten missing eh_catch_typeinfo lang item
66

77
#![no_std]
88

src/test/ui/panic-runtime/need-abort-got-unwind.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// needs-unwind
33
// error-pattern:is incompatible with this crate's strategy of `unwind`
44
// aux-build:needs-abort.rs
5-
// ignore-wasm32-bare compiled with panic=abort by default
65

76
extern crate needs_abort;
87

src/test/ui/panic-runtime/transitive-link-a-bunch.rs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// aux-build:wants-panic-runtime-abort.rs
77
// aux-build:panic-runtime-lang-items.rs
88
// error-pattern: is not compiled with this crate's panic strategy `unwind`
9-
// ignore-wasm32-bare compiled with panic=abort by default
109

1110
#![no_std]
1211
#![no_main]

src/test/ui/panic-runtime/want-unwind-got-abort.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// error-pattern:is not compiled with this crate's panic strategy `unwind`
44
// aux-build:panic-runtime-abort.rs
55
// aux-build:panic-runtime-lang-items.rs
6-
// ignore-wasm32-bare compiled with panic=abort by default
76

87
#![no_std]
98
#![no_main]

src/test/ui/panic-runtime/want-unwind-got-abort2.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// aux-build:panic-runtime-abort.rs
55
// aux-build:wants-panic-runtime-abort.rs
66
// aux-build:panic-runtime-lang-items.rs
7-
// ignore-wasm32-bare compiled with panic=abort by default
87

98
#![no_std]
109
#![no_main]

src/test/ui/panic-while-printing.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
// needs-unwind
3-
// ignore-emscripten no subprocess support
43

54
#![feature(internal_output_capture)]
65

src/test/ui/privacy/reachable-unnameable-items.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// run-pass
2-
// ignore-wasm32-bare compiled with panic=abort by default
32
// needs-unwind
43
// aux-build:reachable-unnameable-items.rs
54

src/test/ui/proc-macro/expand-with-a-macro.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// needs-unwind
33
// aux-build:expand-with-a-macro.rs
44

5-
// ignore-wasm32-bare compiled with panic=abort by default
65

76
#![deny(warnings)]
87

src/test/ui/rfc-1937-termination-trait/termination-trait-in-test.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// run-pass
33
// needs-unwind
44

5-
// ignore-wasm32-bare compiled with panic=abort by default
65

76
#![feature(test)]
87

src/test/ui/rfc-2091-track-caller/std-panic-locations.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
// needs-unwind
3-
// ignore-wasm32-bare compiled with panic=abort by default
43
// revisions: default mir-opt
54
//[mir-opt] compile-flags: -Zmir-opt-level=4
65

src/test/ui/rfcs/rfc1857-drop-order.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
// needs-unwind
3-
// ignore-wasm32-bare compiled with panic=abort by default
43

54
#![allow(dead_code, unreachable_code)]
65

src/test/ui/runtime/rt-explody-panic-payloads.rs

-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// needs-unwind
33
// ignore-emscripten no processes
44
// ignore-sgx no processes
5-
// ignore-wasm32-bare no unwinding panic
6-
// ignore-avr no unwinding panic
7-
// ignore-nvptx64 no unwinding panic
85

96
use std::env;
107
use std::process::Command;

src/test/ui/test-attrs/test-panic-while-printing.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// compile-flags:--test
22
// run-pass
33
// needs-unwind
4-
// ignore-emscripten no subprocess support
54

65
use std::fmt;
76
use std::fmt::{Display, Formatter};

src/test/ui/test-attrs/test-should-fail-good-message.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
// needs-unwind
3-
// ignore-wasm32-bare compiled with panic=abort by default
43
// compile-flags: --test
54
#[test]
65
#[should_panic(expected = "foo")]

src/test/ui/unwind-abis/ffi-unwind-calls-lint.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// build-pass
22
// needs-unwind
3-
// ignore-wasm32-bare compiled with panic=abort by default
43

54
#![feature(c_unwind)]
65
#![warn(ffi_unwind_calls)]

0 commit comments

Comments
 (0)