MIR validation: reject in-place argument/return for packed fields

This commit is contained in:
Ralf Jung
2023-08-24 11:34:23 +02:00
parent 0b31792ef1
commit 739144fc5b
3 changed files with 31 additions and 5 deletions

View File

@@ -34,13 +34,14 @@ where
false
}
_ => {
// We cannot figure out the layout. Conservatively assume that this is disaligned.
debug!("is_disaligned({:?}) - true", place);
true
}
}
}
fn is_within_packed<'tcx, L>(
pub fn is_within_packed<'tcx, L>(
tcx: TyCtxt<'tcx>,
local_decls: &L,
place: Place<'tcx>,