Skip to content

Commit

Permalink
Auto merge of rust-lang#109507 - Amanieu:panic-oom-payload, r=davidtwco
Browse files Browse the repository at this point in the history
Report allocation errors as panics

OOM is now reported as a panic but with a custom payload type (`AllocErrorPanicPayload`) which holds the layout that was passed to `handle_alloc_error`.

This should be review one commit at a time:
- The first commit adds `AllocErrorPanicPayload` and changes allocation errors to always be reported as panics.
- The second commit removes `#[alloc_error_handler]` and the `alloc_error_hook` API.

ACP: rust-lang/libs-team#192

Closes rust-lang#51540
Closes rust-lang#51245
  • Loading branch information
bors committed Apr 22, 2023
2 parents 6df8082 + 35fc578 commit 6d14583
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions crates/hir-def/src/builtin_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,6 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[

rustc_attr!(rustc_allocator, 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)
),
gated!(
default_lib_allocator, Normal, template!(Word), WarnFollowing, allocator_internals,
experimental!(default_lib_allocator),
Expand Down

0 comments on commit 6d14583

Please sign in to comment.