Skip to content

Commit 4c36ef9

Browse files
committed
Auto merge of #113591 - mdibaiee:genericargs-cleanup, r=oli-obk
refactor(rustc_middle): Substs -> GenericArg resolves #110793 - [x] rename `SubstsRef` and `InternalSubsts` to `GenericArgsRef<'tcx>` and `GenericArgs<'tcx>`. - [x] rename variables and fields currently using `substs` to `args`. - [x] update the module name of `ty::subst` to `ty::generic_args` or sth. Make that module private and publicly reexport its content in the ty module. - [x] rename `EarlyBinder::subst(_identity)` to `EarlyBinder::instantiate(_identity)`. - [x] types called `[a-zA-Z]+Substs` renamed to `XArgs`. - [x] functions containing `substs` now use `args` or `generic_args` (mostly the former). However, the verb of "substituting" is still being used here and there, mostly in comments. I think that can be a separate PR as part of rust-lang/rust#110254 to change the verb to `replace_generics` or something similar.
2 parents 51ed29a + 8e79cb6 commit 4c36ef9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/eval.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
380380
tcx,
381381
ty::ParamEnv::reveal_all(),
382382
start_id,
383-
tcx.mk_substs(&[ty::subst::GenericArg::from(main_ret_ty)]),
383+
tcx.mk_args(&[ty::GenericArg::from(main_ret_ty)]),
384384
)
385385
.unwrap()
386386
.unwrap();

src/machine.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
972972
panic!("extern_statics cannot contain wildcards")
973973
};
974974
let (shim_size, shim_align, _kind) = ecx.get_alloc_info(alloc_id);
975-
let def_ty = ecx.tcx.type_of(def_id).subst_identity();
975+
let def_ty = ecx.tcx.type_of(def_id).instantiate_identity();
976976
let extern_decl_layout = ecx.tcx.layout_of(ty::ParamEnv::empty().and(def_ty)).unwrap();
977977
if extern_decl_layout.size != shim_size || extern_decl_layout.align.abi != shim_align {
978978
throw_unsup_format!(

0 commit comments

Comments
 (0)