Tell MirUsedCollector that the pointer alignment checks calls its panic symbol

This commit is contained in:
Ben Kimock
2023-12-06 21:18:37 -05:00
parent f32d29837d
commit aa58ccb53e
@@ -844,6 +844,9 @@ fn visit_terminator(&mut self, terminator: &mir::Terminator<'tcx>, location: Loc
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);