diff options
| author | bors <bors@rust-lang.org> | 2022-12-25 20:51:37 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-12-25 20:51:37 +0000 |
| commit | 8dfb3395411555e93399671d0c41a4ac9ed62b95 (patch) | |
| tree | ae6b2a06eadd038d27fc68a8aaa00b557032a9f0 /src/test/codegen | |
| parent | 298d763fc0ac206cf3ae202459101e36a17071f7 (diff) | |
| parent | c1b443de0e716c0c7bc3cbb226a2e5cfe94a493b (diff) | |
Auto merge of #105997 - RalfJung:immediate-abort, r=eholk
abort immediately on bad mem::zeroed/uninit Now that we have non-unwinding panics, let's use them for these assertions. This re-establishes the property that `mem::uninitialized` and `mem::zeroed` will never unwind -- the earlier approach of causing panics here sometimes led to hard-to-debug segfaults when the surrounding code was not able to cope with the unexpected unwinding. Cc `@bjorn3` I did not touch cranelift but I assume it needs a similar patch. However it has a `codegen_panic` abstraction that I did not want to touch since I didn't know how else it is used.
Diffstat (limited to 'src/test/codegen')
| -rw-r--r-- | src/test/codegen/unwind-abis/c-unwind-abi-panic-abort.rs | 2 | ||||
| -rw-r--r-- | src/test/codegen/unwind-and-panic-abort.rs | 2 | ||||
| -rw-r--r-- | src/test/codegen/vec-shrink-panik.rs | 16 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/test/codegen/unwind-abis/c-unwind-abi-panic-abort.rs b/src/test/codegen/unwind-abis/c-unwind-abi-panic-abort.rs index 34fd401f9e4..ea5bae18e23 100644 --- a/src/test/codegen/unwind-abis/c-unwind-abi-panic-abort.rs +++ b/src/test/codegen/unwind-abis/c-unwind-abi-panic-abort.rs @@ -10,7 +10,7 @@ #[no_mangle] pub unsafe extern "C-unwind" fn rust_item_that_can_unwind() { // Handle both legacy and v0 symbol mangling. - // CHECK: call void @{{.*core9panicking15panic_no_unwind}} + // CHECK: call void @{{.*core9panicking19panic_cannot_unwind}} may_unwind(); } diff --git a/src/test/codegen/unwind-and-panic-abort.rs b/src/test/codegen/unwind-and-panic-abort.rs index b370191bf8c..e43e73b96b9 100644 --- a/src/test/codegen/unwind-and-panic-abort.rs +++ b/src/test/codegen/unwind-and-panic-abort.rs @@ -10,7 +10,7 @@ extern "C-unwind" { // CHECK: Function Attrs:{{.*}}nounwind // CHECK-NEXT: define{{.*}}void @foo // Handle both legacy and v0 symbol mangling. -// CHECK: call void @{{.*core9panicking15panic_no_unwind}} +// CHECK: call void @{{.*core9panicking19panic_cannot_unwind}} #[no_mangle] pub unsafe extern "C" fn foo() { bar(); diff --git a/src/test/codegen/vec-shrink-panik.rs b/src/test/codegen/vec-shrink-panik.rs index 18409014bde..aa6589dc35b 100644 --- a/src/test/codegen/vec-shrink-panik.rs +++ b/src/test/codegen/vec-shrink-panik.rs @@ -18,11 +18,11 @@ pub fn shrink_to_fit(vec: &mut Vec<u32>) { pub fn issue71861(vec: Vec<u32>) -> Box<[u32]> { // CHECK-NOT: panic - // Call to panic_no_unwind in case of double-panic is expected, + // Call to panic_cannot_unwind in case of double-panic is expected, // but other panics are not. // CHECK: cleanup - // CHECK-NEXT: ; call core::panicking::panic_no_unwind - // CHECK-NEXT: panic_no_unwind + // CHECK-NEXT: ; call core::panicking::panic_cannot_unwind + // CHECK-NEXT: panic_cannot_unwind // CHECK-NOT: panic vec.into_boxed_slice() @@ -33,15 +33,15 @@ pub fn issue71861(vec: Vec<u32>) -> Box<[u32]> { pub fn issue75636<'a>(iter: &[&'a str]) -> Box<[&'a str]> { // CHECK-NOT: panic - // Call to panic_no_unwind in case of double-panic is expected, + // Call to panic_cannot_unwind in case of double-panic is expected, // but other panics are not. // CHECK: cleanup - // CHECK-NEXT: ; call core::panicking::panic_no_unwind - // CHECK-NEXT: panic_no_unwind + // CHECK-NEXT: ; call core::panicking::panic_cannot_unwind + // CHECK-NEXT: panic_cannot_unwind // CHECK-NOT: panic iter.iter().copied().collect() } -// CHECK: ; core::panicking::panic_no_unwind -// CHECK: declare void @{{.*}}panic_no_unwind +// CHECK: ; core::panicking::panic_cannot_unwind +// CHECK: declare void @{{.*}}panic_cannot_unwind |
