Skip to content

Commit 11f7b4b

Browse files
Rollup merge of rust-lang#118693 - saethlin:alignment-check-symbol-reachable, r=bjorn3
Tell MirUsedCollector that the pointer alignment checks calls its panic symbol Fixes rust-lang#118683 (not an issue, but that PR is a basically a bug report) When we had `panic_immediate_abort` start adding `#[inline]` to this panic function, builds started breaking because we failed to write up the MIR assert terminator to the correct panic shim. Things happened to work before by pure luck because without this feature enabled, the function we're inserting calls to is `#[inline(never)]` so we always generated code for it. r? bjorn3
2 parents 8448c3c + aa58ccb commit 11f7b4b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/rustc_monomorphize/src/collector.rs

+3
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,9 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirUsedCollector<'a, 'tcx> {
844844
mir::TerminatorKind::Assert { ref msg, .. } => {
845845
let lang_item = match &**msg {
846846
mir::AssertKind::BoundsCheck { .. } => LangItem::PanicBoundsCheck,
847+
mir::AssertKind::MisalignedPointerDereference { .. } => {
848+
LangItem::PanicMisalignedPointerDereference
849+
}
847850
_ => LangItem::Panic,
848851
};
849852
push_mono_lang_item(self, lang_item);

0 commit comments

Comments
 (0)