diff options
| author | bors <bors@rust-lang.org> | 2022-10-12 14:39:43 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-10-12 14:39:43 +0000 |
| commit | 538f118da1409759ba198acc0ff62070bc6d2dce (patch) | |
| tree | 3becd0807c9f252f25ed5c7936e8bfc0f2f1fdff /src | |
| parent | 50f6d337c632cbb5bd1dc3a80b5d428cebd8dce4 (diff) | |
| parent | 38c78a9ac17caefd4c5e6d0b332814b2ac2cf3a8 (diff) | |
Auto merge of #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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.rs | 4 | ||||
| -rw-r--r-- | src/tools/rust-analyzer/crates/hir-def/src/builtin_attr.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.rs b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.rs index d9aacdb8aea..f85ad5ae507 100644 --- a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.rs +++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.rs @@ -1,7 +1,7 @@ //@revisions: extern_block definition both #![feature(rustc_attrs, c_unwind)] -#[cfg_attr(any(definition, both), rustc_allocator_nounwind)] +#[cfg_attr(any(definition, both), rustc_nounwind)] #[no_mangle] extern "C-unwind" fn nounwind() { //[definition]~^ ERROR: abnormal termination: the program aborted execution @@ -11,7 +11,7 @@ extern "C-unwind" fn nounwind() { fn main() { extern "C-unwind" { - #[cfg_attr(any(extern_block, both), rustc_allocator_nounwind)] + #[cfg_attr(any(extern_block, both), rustc_nounwind)] fn nounwind(); } unsafe { nounwind() } diff --git a/src/tools/rust-analyzer/crates/hir-def/src/builtin_attr.rs b/src/tools/rust-analyzer/crates/hir-def/src/builtin_attr.rs index 0e7ce5f85f9..39581b33a8d 100644 --- a/src/tools/rust-analyzer/crates/hir-def/src/builtin_attr.rs +++ b/src/tools/rust-analyzer/crates/hir-def/src/builtin_attr.rs @@ -379,7 +379,7 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[ // ========================================================================== rustc_attr!(rustc_allocator, Normal, template!(Word), WarnFollowing, IMPL_DETAIL), - rustc_attr!(rustc_allocator_nounwind, Normal, template!(Word), WarnFollowing, IMPL_DETAIL), + rustc_attr!(rustc_nounwind, Normal, template!(Word), WarnFollowing, IMPL_DETAIL), gated!( alloc_error_handler, Normal, template!(Word), WarnFollowing, experimental!(alloc_error_handler) |
