Rollup merge of #120683 - RalfJung:symbolic-alignment-ice, r=oli-obk

miri: fix ICE with symbolic alignment check on extern static

Fixes https://github.com/rust-lang/miri/issues/3288. Also fixes [this example](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=38ee338ff10726be72bdd6efa3386763).

This could almost be a Miri PR, except for that typo fix in the validator. I started this as a rustc patch since I thought I need rustc changes, and now it'd be too annoying to turn this into a Miri PR...

r? `@oli-obk`
This commit is contained in:
Matthias Krüger 2024-02-06 19:40:10 +01:00 committed by GitHub
commit 6908d3ec9e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 76 additions and 27 deletions

View file

@ -993,10 +993,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
// Complain about any other kind of error -- those are bad because we'd like to
// report them in a way that shows *where* in the value the issue lies.
Err(err) => {
bug!(
"Unexpected Undefined Behavior error during validation: {}",
self.format_error(err)
);
bug!("Unexpected error during validation: {}", self.format_error(err));
}
}
}