From aa58ccb53e289aa465a070cc27d2d773d274d1d1 Mon Sep 17 00:00:00 2001 From: Ben Kimock Date: Wed, 6 Dec 2023 21:18:37 -0500 Subject: [PATCH] Tell MirUsedCollector that the pointer alignment checks calls its panic symbol --- compiler/rustc_monomorphize/src/collector.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/rustc_monomorphize/src/collector.rs b/compiler/rustc_monomorphize/src/collector.rs index b882a038711c3..8609aa2bfb5fb 100644 --- a/compiler/rustc_monomorphize/src/collector.rs +++ b/compiler/rustc_monomorphize/src/collector.rs @@ -844,6 +844,9 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirUsedCollector<'a, 'tcx> { mir::TerminatorKind::Assert { ref msg, .. } => { let lang_item = match &**msg { mir::AssertKind::BoundsCheck { .. } => LangItem::PanicBoundsCheck, + mir::AssertKind::MisalignedPointerDereference { .. } => { + LangItem::PanicMisalignedPointerDereference + } _ => LangItem::Panic, }; push_mono_lang_item(self, lang_item);