Skip to content

Commit 43a1b02

Browse files
committed
Remove c_unwind from tests and fix tests
1 parent d0f7aa4 commit 43a1b02

Some content is hidden

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

42 files changed

+25
-71
lines changed

src/tools/miri/tests/fail-dep/concurrency/unwind_top_of_stack.rs

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
//! Unwinding past the top frame of a stack is Undefined Behavior.
66
7-
#![feature(c_unwind)]
8-
97
use std::{mem, ptr};
108

119
extern "C-unwind" fn thread_start(_null: *mut libc::c_void) -> *mut libc::c_void {

src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@compile-flags: -Zmiri-disable-abi-check
2-
#![feature(c_unwind)]
32

43
#[no_mangle]
54
extern "C-unwind" fn unwind() {

src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
55
//@normalize-stderr-test: "\n +at [^\n]+" -> ""
66
//@[definition,both]error-in-other-file: aborted execution
7-
#![feature(rustc_attrs, c_unwind)]
7+
#![feature(rustc_attrs)]
88

99
#[cfg_attr(any(definition, both), rustc_nounwind)]
1010
#[no_mangle]

src/tools/miri/tests/fail/panic/bad_miri_start_panic.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@compile-flags: -Zmiri-disable-abi-check
22
// This feature is required to trigger the error using the "C" ABI.
3-
#![feature(c_unwind)]
43

54
extern "C" {
65
fn miri_start_panic(payload: *mut u8) -> !;

src/tools/miri/tests/fail/panic/bad_unwind.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(c_unwind)]
2-
31
//! Unwinding when the caller ABI is "C" (without "-unwind") is UB.
42
53
extern "C-unwind" fn unwind() {

src/tools/miri/tests/fail/terminate-terminator.rs

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
// Enable MIR inlining to ensure that `TerminatorKind::UnwindTerminate` is generated
88
// instead of just `UnwindAction::Terminate`.
99

10-
#![feature(c_unwind)]
11-
1210
struct Foo;
1311

1412
impl Drop for Foo {

src/tools/miri/tests/fail/unwind-action-terminate.rs

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
//@normalize-stderr-test: "\| +\^+" -> "| ^"
44
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
55
//@normalize-stderr-test: "\n +at [^\n]+" -> ""
6-
#![feature(c_unwind)]
7-
86
extern "C" fn panic_abort() {
97
panic!()
108
}

src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// found in this form" errors works without `-C prefer-dynamic` (`panic!` calls foreign function
33
// `__rust_start_panic`).
44
// no-prefer-dynamic
5-
#![feature(c_unwind, unboxed_closures)]
5+
#![feature(unboxed_closures)]
66

77
use std::panic;
88

tests/assembly/asm/aarch64-modifiers.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// assembly-output: emit-asm
2-
// compile-flags: -O
2+
// compile-flags: -O -C panic=abort
33
// compile-flags: --target aarch64-unknown-linux-gnu
44
// needs-llvm-components: aarch64
55

tests/assembly/asm/arm-modifiers.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// assembly-output: emit-asm
2-
// compile-flags: -O
2+
// compile-flags: -O -C panic=abort
33
// compile-flags: --target armv7-unknown-linux-gnueabihf
44
// compile-flags: -C target-feature=+neon
55
// needs-llvm-components: arm

tests/assembly/asm/x86-modifiers.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// revisions: x86_64 i686
22
// assembly-output: emit-asm
3-
// compile-flags: -O
3+
// compile-flags: -O -C panic=abort
44
//[x86_64] compile-flags: --target x86_64-unknown-linux-gnu
55
//[x86_64] needs-llvm-components: x86
66
//[i686] compile-flags: --target i686-unknown-linux-gnu

tests/codegen/avr/avr-func-addrspace.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: -O --target=avr-unknown-gnu-atmega328 --crate-type=rlib
1+
// compile-flags: -O --target=avr-unknown-gnu-atmega328 --crate-type=rlib -C panic=abort
22
// needs-llvm-components: avr
33

44
// This test validates that function pointers can be stored in global variables

tests/codegen/catch-unwind.rs

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
// ignore-loongarch64 FIXME
1515

1616
#![crate_type = "lib"]
17-
#![feature(c_unwind)]
1817

1918
extern "C" {
2019
fn bar();

tests/codegen/cffi/c-variadic.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
#![crate_type = "lib"]
66
#![feature(c_variadic)]
7-
#![feature(c_unwind)]
87
#![no_std]
98
use core::ffi::VaList;
109

tests/codegen/debuginfo-inline-callsite-location.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#![crate_type = "lib"]
2121

2222
#[no_mangle]
23-
extern "C" fn add_numbers(x: &Option<i32>, y: &Option<i32>) -> i32 {
23+
extern "C-unwind" fn add_numbers(x: &Option<i32>, y: &Option<i32>) -> i32 {
2424
let x1 = x.unwrap();
2525
let y1 = y.unwrap();
2626

tests/codegen/unwind-abis/aapcs-unwind-abi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// needs-llvm-components: arm
22
// compile-flags: --target=armv7-unknown-linux-gnueabihf --crate-type=rlib -Cno-prepopulate-passes
33
#![no_core]
4-
#![feature(no_core, lang_items, c_unwind)]
4+
#![feature(no_core, lang_items)]
55
#[lang="sized"]
66
trait Sized { }
77

tests/codegen/unwind-abis/c-unwind-abi-panic-abort.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// when the code is compiled with `panic=abort`.
55

66
#![crate_type = "lib"]
7-
#![feature(c_unwind)]
87

98
// CHECK: @rust_item_that_can_unwind() unnamed_addr [[ATTR0:#[0-9]+]]
109
#[no_mangle]

tests/codegen/unwind-abis/c-unwind-abi.rs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// to prevent LLVM from inferring the attribute.
77

88
#![crate_type = "lib"]
9-
#![feature(c_unwind)]
109

1110
// CHECK: @rust_item_that_cannot_unwind() unnamed_addr #0 {
1211
#[no_mangle]

tests/codegen/unwind-abis/cdecl-unwind-abi.rs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// disable optimizations above to prevent LLVM from inferring the attribute.
77

88
#![crate_type = "lib"]
9-
#![feature(c_unwind)]
109

1110
// CHECK: @rust_item_that_cannot_unwind() unnamed_addr #0 {
1211
#[no_mangle]

tests/codegen/unwind-abis/fastcall-unwind-abi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// needs-llvm-components: x86
22
// compile-flags: --target=i686-pc-windows-msvc --crate-type=rlib -Cno-prepopulate-passes
33
#![no_core]
4-
#![feature(no_core, lang_items, c_unwind)]
4+
#![feature(no_core, lang_items)]
55
#[lang="sized"]
66
trait Sized { }
77

tests/codegen/unwind-abis/nounwind-on-stable-panic-unwind.rs

-18
This file was deleted.

tests/codegen/unwind-abis/nounwind.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// ignore-wasm32-bare compiled with panic=abort by default
33

44
#![crate_type = "lib"]
5-
#![feature(c_unwind)]
65

76
// We disable optimizations to prevent LLVM from inferring the attribute.
87

tests/codegen/unwind-abis/stdcall-unwind-abi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// needs-llvm-components: x86
22
// compile-flags: --target=i686-pc-windows-msvc --crate-type=rlib -Cno-prepopulate-passes
33
#![no_core]
4-
#![feature(no_core, lang_items, c_unwind)]
4+
#![feature(no_core, lang_items)]
55
#[lang="sized"]
66
trait Sized { }
77

tests/codegen/unwind-abis/system-unwind-abi.rs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// optimizations above to prevent LLVM from inferring the attribute.
77

88
#![crate_type = "lib"]
9-
#![feature(c_unwind)]
109

1110
// CHECK: @rust_item_that_cannot_unwind() unnamed_addr #0 {
1211
#[no_mangle]

tests/codegen/unwind-abis/sysv64-unwind-abi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// needs-llvm-components: x86
22
// compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=rlib -Cno-prepopulate-passes
33
#![no_core]
4-
#![feature(no_core, lang_items, c_unwind)]
4+
#![feature(no_core, lang_items)]
55
#[lang="sized"]
66
trait Sized { }
77

tests/codegen/unwind-abis/thiscall-unwind-abi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// needs-llvm-components: x86
22
// compile-flags: --target=i686-pc-windows-msvc --crate-type=rlib -Cno-prepopulate-passes
33
#![no_core]
4-
#![feature(no_core, lang_items, c_unwind)]
4+
#![feature(no_core, lang_items)]
55
#[lang="sized"]
66
trait Sized { }
77

tests/codegen/unwind-abis/vectorcall-unwind-abi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// needs-llvm-components: x86
22
// compile-flags: --target=i686-pc-windows-msvc --crate-type=rlib -Cno-prepopulate-passes
33
#![no_core]
4-
#![feature(no_core, lang_items, c_unwind, abi_vectorcall)]
4+
#![feature(no_core, lang_items, abi_vectorcall)]
55
#[lang="sized"]
66
trait Sized { }
77

tests/codegen/unwind-abis/win64-unwind-abi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// needs-llvm-components: x86
22
// compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=rlib -Cno-prepopulate-passes
33
#![no_core]
4-
#![feature(no_core, lang_items, c_unwind)]
4+
#![feature(no_core, lang_items)]
55
#[lang="sized"]
66
trait Sized { }
77

tests/codegen/unwind-and-panic-abort.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// compile-flags: -C panic=abort
22

33
#![crate_type = "lib"]
4-
#![feature(c_unwind)]
54

65
extern "C-unwind" {
76
fn bar();

tests/codegen/unwind-extern-exports.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// needs-unwind
44

55
#![crate_type = "lib"]
6-
#![feature(c_unwind)]
76

87
// Make sure these all do *not* get the attribute.
98
// We disable optimizations to prevent LLVM from inferring the attribute.

tests/codegen/unwind-extern-imports.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// needs-unwind
44

55
#![crate_type = "lib"]
6-
#![feature(c_unwind)]
76

87
extern "C" {
98
// CHECK: Function Attrs:{{.*}}nounwind

tests/coverage/abort.cov-map

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Function name: abort::main
2-
Raw bytes (105): 0x[01, 01, 12, 01, 47, 05, 09, 03, 0d, 42, 11, 03, 0d, 11, 3e, 42, 11, 03, 0d, 3b, 15, 11, 3e, 42, 11, 03, 0d, 15, 36, 3b, 15, 11, 3e, 42, 11, 03, 0d, 05, 09, 0d, 01, 0d, 01, 01, 1b, 03, 02, 0b, 00, 18, 42, 01, 0c, 00, 19, 11, 00, 1a, 02, 0a, 3e, 02, 0a, 00, 0b, 3b, 02, 0c, 00, 19, 15, 00, 1a, 00, 31, 36, 00, 31, 00, 32, 33, 04, 0c, 00, 19, 05, 00, 1a, 00, 31, 09, 00, 31, 00, 32, 47, 01, 09, 00, 17, 0d, 02, 05, 01, 02]
2+
Raw bytes (105): 0x[01, 01, 12, 01, 47, 05, 09, 03, 0d, 42, 11, 03, 0d, 11, 3e, 42, 11, 03, 0d, 3b, 15, 11, 3e, 42, 11, 03, 0d, 15, 36, 3b, 15, 11, 3e, 42, 11, 03, 0d, 05, 09, 0d, 01, 0c, 01, 01, 1b, 03, 02, 0b, 00, 18, 42, 01, 0c, 00, 19, 11, 00, 1a, 02, 0a, 3e, 02, 0a, 00, 0b, 3b, 02, 0c, 00, 19, 15, 00, 1a, 00, 31, 36, 00, 31, 00, 32, 33, 04, 0c, 00, 19, 05, 00, 1a, 00, 31, 09, 00, 31, 00, 32, 47, 01, 09, 00, 17, 0d, 02, 05, 01, 02]
33
Number of files: 1
44
- file 0 => global file 1
55
Number of expressions: 18
@@ -22,7 +22,7 @@ Number of expressions: 18
2222
- expression 16 operands: lhs = Expression(0, Add), rhs = Counter(3)
2323
- expression 17 operands: lhs = Counter(1), rhs = Counter(2)
2424
Number of file 0 mappings: 13
25-
- Code(Counter(0)) at (prev + 13, 1) to (start + 1, 27)
25+
- Code(Counter(0)) at (prev + 12, 1) to (start + 1, 27)
2626
- Code(Expression(0, Add)) at (prev + 2, 11) to (start + 0, 24)
2727
= (c0 + (c1 + c2))
2828
- Code(Expression(16, Sub)) at (prev + 1, 12) to (start + 0, 25)
@@ -44,13 +44,13 @@ Number of file 0 mappings: 13
4444
- Code(Counter(3)) at (prev + 2, 5) to (start + 1, 2)
4545

4646
Function name: abort::might_abort
47-
Raw bytes (21): 0x[01, 01, 01, 01, 05, 03, 01, 04, 01, 01, 14, 05, 02, 09, 01, 24, 02, 02, 0c, 03, 02]
47+
Raw bytes (21): 0x[01, 01, 01, 01, 05, 03, 01, 03, 01, 01, 14, 05, 02, 09, 01, 24, 02, 02, 0c, 03, 02]
4848
Number of files: 1
4949
- file 0 => global file 1
5050
Number of expressions: 1
5151
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
5252
Number of file 0 mappings: 3
53-
- Code(Counter(0)) at (prev + 4, 1) to (start + 1, 20)
53+
- Code(Counter(0)) at (prev + 3, 1) to (start + 1, 20)
5454
- Code(Counter(1)) at (prev + 2, 9) to (start + 1, 36)
5555
- Code(Expression(0, Sub)) at (prev + 2, 12) to (start + 3, 2)
5656
= (c0 - c1)

tests/coverage/abort.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(c_unwind)]
21
#![allow(unused_assignments)]
32

43
extern "C" fn might_abort(should_abort: bool) {

tests/run-make/forced-unwind-terminate-pof/foo.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Tests that forced unwind through POF Rust frames wouldn't trigger our terminating guards.
22

3-
#![feature(c_unwind)]
43
#![no_main]
54

65
extern "C-unwind" {

tests/run-make/no-builtins-lto/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ include ../tools.mk
88
# Others will use the built-in memcpy.
99

1010
all:
11-
$(RUSTC) -C linker-plugin-lto -C opt-level=2 -C debuginfo=0 foo.rs
12-
$(RUSTC) -C linker-plugin-lto -C opt-level=2 -C debuginfo=0 no_builtins.rs
13-
$(RUSTC) main.rs -C lto -C opt-level=2 -C debuginfo=0 -C save-temps -C metadata=1 -C codegen-units=1
11+
$(RUSTC) -C linker-plugin-lto -C panic=abort -C opt-level=2 -C debuginfo=0 foo.rs
12+
$(RUSTC) -C linker-plugin-lto -C panic=abort -C opt-level=2 -C debuginfo=0 no_builtins.rs
13+
$(RUSTC) main.rs -C lto -C panic=abort -C opt-level=2 -C debuginfo=0 -C save-temps -C metadata=1 -C codegen-units=1
1414
"$(LLVM_BIN_DIR)"/llvm-dis $(TMPDIR)/main.main.*-cgu.0.rcgu.lto.input.bc -o $(TMPDIR)/lto.ll
1515
cat "$(TMPDIR)"/lto.ll | "$(LLVM_FILECHECK)" filecheck.lto.txt

tests/ui/asm/x86_64/may_unwind.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ impl Drop for Foo<'_> {
1616
}
1717
}
1818

19-
extern "C" fn panicky() {
19+
extern "C-unwind" fn panicky() {
2020
resume_unwind(Box::new(()));
2121
}
2222

tests/ui/consts/const-eval/unwind-abort.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(c_unwind, const_extern_fn)]
1+
#![feature(const_extern_fn)]
22

33
const extern "C" fn foo() {
44
panic!() //~ ERROR evaluation of constant value failed

tests/ui/consts/unwind-abort.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// check-pass
22

3-
#![feature(c_unwind, const_extern_fn)]
3+
#![feature(const_extern_fn)]
44

55
// We don't unwind in const-eval anyways.
66
const extern "C" fn foo() {

tests/ui/panics/abort-on-panic.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
//[next] compile-flags: -Znext-solver
44

55
#![allow(unused_must_use)]
6-
#![feature(c_unwind)]
76
#![feature(panic_always_abort)]
87
// Since we mark some ABIs as "nounwind" to LLVM, we must make sure that
98
// we never unwind through them.

tests/ui/panics/panic-in-ffi.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
// normalize-stderr-test: "(core/src/panicking\.rs):[0-9]+:[0-9]+" -> "$1:$$LINE:$$COL"
88
// needs-unwind
99
// ignore-emscripten "RuntimeError" junk in output
10-
#![feature(c_unwind)]
1110

1211
extern "C" fn panic_in_ffi() {
1312
panic!("Test");

tests/ui/panics/panic-in-ffi.run.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
thread 'main' panicked at $DIR/panic-in-ffi.rs:13:5:
1+
thread 'main' panicked at $DIR/panic-in-ffi.rs:12:5:
22
Test
33
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
44
thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL:

tests/ui/unwind-abis/feature-gate-c_unwind.rs

-4
This file was deleted.

0 commit comments

Comments
 (0)