Skip to content

Commit be42b04

Browse files
committed
Make alignment checks a future incompat lint
1 parent 53003af commit be42b04

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/machine.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ use rustc_span::def_id::{CrateNum, DefId};
2424
use rustc_span::Symbol;
2525
use rustc_target::abi::Size;
2626
use rustc_target::spec::abi::Abi;
27+
use rustc_const_eval::const_eval::CheckAlignment;
2728

2829
use crate::{
2930
concurrency::{data_race, weak_memory},
@@ -752,8 +753,12 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
752753
const PANIC_ON_ALLOC_FAIL: bool = false;
753754

754755
#[inline(always)]
755-
fn enforce_alignment(ecx: &MiriInterpCx<'mir, 'tcx>) -> bool {
756-
ecx.machine.check_alignment != AlignmentCheck::None
756+
fn enforce_alignment(ecx: &MiriInterpCx<'mir, 'tcx>) -> CheckAlignment {
757+
if ecx.machine.check_alignment == AlignmentCheck::None {
758+
CheckAlignment::No
759+
} else {
760+
CheckAlignment::Error
761+
}
757762
}
758763

759764
#[inline(always)]

0 commit comments

Comments
 (0)