]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #105997 - RalfJung:immediate-abort, r=eholk
authorbors <bors@rust-lang.org>
Sun, 25 Dec 2022 20:51:37 +0000 (20:51 +0000)
committerbors <bors@rust-lang.org>
Sun, 25 Dec 2022 20:51:37 +0000 (20:51 +0000)
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.


Trivial merge