Skip to content

Commit 8c9976a

Browse files
committed
Auto merge of #107753 - kylematsuda:type-of, r=BoxyUwU
Switch to `EarlyBinder` for `type_of` query Part of the work to finish #105779 and implement rust-lang/types-team#78. Several queries `X` have a `bound_X` variant that wraps the output in `EarlyBinder`. This adds `EarlyBinder` to the return type of the `type_of` query and removes `bound_type_of`. r? `@lcnr`
2 parents 1b4db45 + 120d744 commit 8c9976a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/machine.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,8 +901,9 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
901901
panic!("extern_statics cannot contain wildcards")
902902
};
903903
let (shim_size, shim_align, _kind) = ecx.get_alloc_info(alloc_id);
904+
let def_ty = ecx.tcx.type_of(def_id).subst_identity();
904905
let extern_decl_layout =
905-
ecx.tcx.layout_of(ty::ParamEnv::empty().and(ecx.tcx.type_of(def_id))).unwrap();
906+
ecx.tcx.layout_of(ty::ParamEnv::empty().and(def_ty)).unwrap();
906907
if extern_decl_layout.size != shim_size || extern_decl_layout.align.abi != shim_align {
907908
throw_unsup_format!(
908909
"`extern` static `{name}` from crate `{krate}` has been declared \

0 commit comments

Comments
 (0)