Tell MirUsedCollector that the pointer alignment checks calls its panic symbol
This commit is contained in:
parent
f32d29837d
commit
aa58ccb53e
1 changed files with 3 additions and 0 deletions
|
@ -844,6 +844,9 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirUsedCollector<'a, 'tcx> {
|
||||||
mir::TerminatorKind::Assert { ref msg, .. } => {
|
mir::TerminatorKind::Assert { ref msg, .. } => {
|
||||||
let lang_item = match &**msg {
|
let lang_item = match &**msg {
|
||||||
mir::AssertKind::BoundsCheck { .. } => LangItem::PanicBoundsCheck,
|
mir::AssertKind::BoundsCheck { .. } => LangItem::PanicBoundsCheck,
|
||||||
|
mir::AssertKind::MisalignedPointerDereference { .. } => {
|
||||||
|
LangItem::PanicMisalignedPointerDereference
|
||||||
|
}
|
||||||
_ => LangItem::Panic,
|
_ => LangItem::Panic,
|
||||||
};
|
};
|
||||||
push_mono_lang_item(self, lang_item);
|
push_mono_lang_item(self, lang_item);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue