This commit is contained in:
The Miri Cronjob Bot 2024-11-19 05:04:30 +00:00
parent cfc5961ca3
commit 39a9512478
3 changed files with 4 additions and 6 deletions

View file

@ -274,7 +274,7 @@ pub fn create_ecx<'tcx>(
tcx,
rustc_span::DUMMY_SP,
typing_env.param_env,
MiriMachine::new(config, layout_cx)
MiriMachine::new(config, layout_cx),
);
// Some parts of initialization require a full `InterpCx`.

View file

@ -116,8 +116,7 @@ pub fn resolve_path<'tcx>(
/// Gets the layout of a type at a path.
#[track_caller]
pub fn path_ty_layout<'tcx>(cx: &impl LayoutOf<'tcx>, path: &[&str]) -> TyAndLayout<'tcx> {
let ty = resolve_path(cx.tcx(), path, Namespace::TypeNS)
.ty(cx.tcx(), cx.typing_env());
let ty = resolve_path(cx.tcx(), path, Namespace::TypeNS).ty(cx.tcx(), cx.typing_env());
cx.layout_of(ty).to_result().ok().unwrap()
}

View file

@ -1127,9 +1127,8 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
};
let info = ecx.get_alloc_info(alloc_id);
let def_ty = ecx.tcx.type_of(def_id).instantiate_identity();
let extern_decl_layout = ecx.tcx.layout_of(
ecx.typing_env().as_query_input(def_ty)
).unwrap();
let extern_decl_layout =
ecx.tcx.layout_of(ecx.typing_env().as_query_input(def_ty)).unwrap();
if extern_decl_layout.size != info.size || extern_decl_layout.align.abi != info.align {
throw_unsup_format!(
"extern static `{link_name}` has been declared as `{krate}::{name}` \