Skip to content

Commit 2530fe2

Browse files
committedOct 12, 2022
Auto merge of rust-lang#102732 - RalfJung:assert_unsafe_precondition2, r=bjorn3
nicer errors from assert_unsafe_precondition This makes the errors shown by cargo-careful nicer, and since `panic_no_unwind` is `nounwind noreturn` it hopefully doesn't have bad codegen impact. Thanks to `@bjorn3` for the hint! Would be nice if we could somehow supply our own (static) message to print, currently it always prints `panic in a function that cannot unwind`. But still, this is better than before.
2 parents a0c0085 + 06d565c commit 2530fe2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎tests/fail/function_calls/exported_symbol_bad_unwind2.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@revisions: extern_block definition both
22
#![feature(rustc_attrs, c_unwind)]
33

4-
#[cfg_attr(any(definition, both), rustc_allocator_nounwind)]
4+
#[cfg_attr(any(definition, both), rustc_nounwind)]
55
#[no_mangle]
66
extern "C-unwind" fn nounwind() {
77
//[definition]~^ ERROR: abnormal termination: the program aborted execution
@@ -11,7 +11,7 @@ extern "C-unwind" fn nounwind() {
1111

1212
fn main() {
1313
extern "C-unwind" {
14-
#[cfg_attr(any(extern_block, both), rustc_allocator_nounwind)]
14+
#[cfg_attr(any(extern_block, both), rustc_nounwind)]
1515
fn nounwind();
1616
}
1717
unsafe { nounwind() }

0 commit comments

Comments
 (0)
Please sign in to comment.