Dejargnonize subst

This commit is contained in:
Shoyu Vanilla 2024-02-12 15:39:32 +09:00
parent 084ce5bdb5
commit 3856df059e
128 changed files with 574 additions and 541 deletions

View file

@ -477,7 +477,7 @@ struct CloneShimBuilder<'tcx> {
impl<'tcx> CloneShimBuilder<'tcx> {
fn new(tcx: TyCtxt<'tcx>, def_id: DefId, self_ty: Ty<'tcx>) -> Self {
// we must subst the self_ty because it's
// we must instantiate the self_ty because it's
// otherwise going to be TySelf and we can't index
// or access fields of a Place of type TySelf.
let sig = tcx.fn_sig(def_id).instantiate(tcx, &[self_ty.into()]);
@ -716,8 +716,8 @@ fn build_call_shim<'tcx>(
call_kind: CallKind<'tcx>,
) -> Body<'tcx> {
// `FnPtrShim` contains the fn pointer type that a call shim is being built for - this is used
// to substitute into the signature of the shim. It is not necessary for users of this
// MIR body to perform further substitutions (see `InstanceDef::has_polymorphic_mir_body`).
// to instantiate into the signature of the shim. It is not necessary for users of this
// MIR body to perform further instantiations (see `InstanceDef::has_polymorphic_mir_body`).
let (sig_args, untuple_args) = if let ty::InstanceDef::FnPtrShim(_, ty) = instance {
let sig = tcx.instantiate_bound_regions_with_erased(ty.fn_sig(tcx));