Skip to content

Commit

Permalink
Unrolled build for rust-lang#118693
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rust-timer authored Dec 8, 2023
2 parents 6c470a5 + aa58ccb commit 010eed4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compiler/rustc_monomorphize/src/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 010eed4

Please sign in to comment.