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 /compiler/rustc_monomorphize/src | |
| 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 'compiler/rustc_monomorphize/src')
| -rw-r--r-- | compiler/rustc_monomorphize/src/collector.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_monomorphize/src/collector.rs b/compiler/rustc_monomorphize/src/collector.rs index deeeb9af4eb..59cc500a99d 100644 --- a/compiler/rustc_monomorphize/src/collector.rs +++ b/compiler/rustc_monomorphize/src/collector.rs @@ -843,7 +843,7 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirNeighborCollector<'a, 'tcx> { mir::TerminatorKind::Abort { .. } => { let instance = Instance::mono( tcx, - tcx.require_lang_item(LangItem::PanicNoUnwind, Some(source)), + tcx.require_lang_item(LangItem::PanicCannotUnwind, Some(source)), ); if should_codegen_locally(tcx, &instance) { self.output.push(create_fn_mono_item(tcx, instance, source)); |
