Skip to content

Commit b324739

Browse files
committed
Merge from rustc
2 parents 02ed422 + e07302d commit b324739

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/eval.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
363363
tcx,
364364
ty::ParamEnv::reveal_all(),
365365
start_id,
366-
tcx.mk_substs(::std::iter::once(ty::subst::GenericArg::from(main_ret_ty))),
366+
tcx.intern_substs(&[ty::subst::GenericArg::from(main_ret_ty)]),
367367
)
368368
.unwrap()
369369
.unwrap();

src/machine.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,8 +907,9 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
907907
panic!("extern_statics cannot contain wildcards")
908908
};
909909
let (shim_size, shim_align, _kind) = ecx.get_alloc_info(alloc_id);
910+
let def_ty = ecx.tcx.type_of(def_id).subst_identity();
910911
let extern_decl_layout =
911-
ecx.tcx.layout_of(ty::ParamEnv::empty().and(ecx.tcx.type_of(def_id))).unwrap();
912+
ecx.tcx.layout_of(ty::ParamEnv::empty().and(def_ty)).unwrap();
912913
if extern_decl_layout.size != shim_size || extern_decl_layout.align.abi != shim_align {
913914
throw_unsup_format!(
914915
"`extern` static `{name}` from crate `{krate}` has been declared \

0 commit comments

Comments
 (0)