This commit is contained in:
Ralf Jung 2023-02-18 20:38:08 +01:00
parent 036929d86d
commit b76b26ee1a

View file

@ -908,8 +908,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
};
let (shim_size, shim_align, _kind) = ecx.get_alloc_info(alloc_id);
let def_ty = ecx.tcx.type_of(def_id).subst_identity();
let extern_decl_layout =
ecx.tcx.layout_of(ty::ParamEnv::empty().and(def_ty)).unwrap();
let extern_decl_layout = ecx.tcx.layout_of(ty::ParamEnv::empty().and(def_ty)).unwrap();
if extern_decl_layout.size != shim_size || extern_decl_layout.align.abi != shim_align {
throw_unsup_format!(
"`extern` static `{name}` from crate `{krate}` has been declared \