diff options
| author | Gary Guo <gary@garyguo.net> | 2022-10-10 22:40:40 +0100 |
|---|---|---|
| committer | Gary Guo <gary@garyguo.net> | 2023-04-06 09:34:16 +0100 |
| commit | 0a5dac3062ffc80a283943e49e2ada08f0b0eaf7 (patch) | |
| tree | 5110a2f63038db9e3e03883b3d3b5685452a5719 /compiler/rustc_monomorphize/src | |
| parent | 5e6ed132fa8a1bd1ec6b365e61e9e290528c90f5 (diff) | |
| download | rust-0a5dac3062ffc80a283943e49e2ada08f0b0eaf7.tar.gz rust-0a5dac3062ffc80a283943e49e2ada08f0b0eaf7.zip | |
Add `UnwindAction::Terminate`
Diffstat (limited to 'compiler/rustc_monomorphize/src')
| -rw-r--r-- | compiler/rustc_monomorphize/src/collector.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/rustc_monomorphize/src/collector.rs b/compiler/rustc_monomorphize/src/collector.rs index f41edff8513..05253bb65ac 100644 --- a/compiler/rustc_monomorphize/src/collector.rs +++ b/compiler/rustc_monomorphize/src/collector.rs @@ -872,6 +872,16 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirNeighborCollector<'a, 'tcx> { | mir::TerminatorKind::FalseUnwind { .. } => bug!(), } + if let Some(mir::UnwindAction::Terminate) = terminator.unwind() { + let instance = Instance::mono( + tcx, + tcx.require_lang_item(LangItem::PanicCannotUnwind, Some(source)), + ); + if should_codegen_locally(tcx, &instance) { + self.output.push(create_fn_mono_item(tcx, instance, source)); + } + } + self.super_terminator(terminator, location); } |
