Stop passing the self-type as a separate argument.
This commit is contained in:
parent
a4da3f8863
commit
7658e0fccf
38 changed files with 113 additions and 164 deletions
|
@ -238,10 +238,9 @@ pub fn predicate_for_trait_def<'tcx>(
|
|||
cause: ObligationCause<'tcx>,
|
||||
trait_def_id: DefId,
|
||||
recursion_depth: usize,
|
||||
self_ty: Ty<'tcx>,
|
||||
params: impl IntoIterator<Item = GenericArg<'tcx>, IntoIter: ExactSizeIterator>,
|
||||
params: impl IntoIterator<Item = impl Into<GenericArg<'tcx>>>,
|
||||
) -> PredicateObligation<'tcx> {
|
||||
let trait_ref = tcx.mk_trait_ref(trait_def_id, self_ty, params);
|
||||
let trait_ref = tcx.mk_trait_ref(trait_def_id, params);
|
||||
predicate_for_trait_ref(tcx, cause, param_env, trait_ref, recursion_depth)
|
||||
}
|
||||
|
||||
|
@ -304,7 +303,7 @@ pub fn closure_trait_ref_and_return_type<'tcx>(
|
|||
TupleArgumentsFlag::Yes => tcx.intern_tup(sig.skip_binder().inputs()),
|
||||
};
|
||||
debug_assert!(!self_ty.has_escaping_bound_vars());
|
||||
let trait_ref = tcx.mk_trait_ref(fn_trait_def_id, self_ty, [arguments_tuple.into()]);
|
||||
let trait_ref = tcx.mk_trait_ref(fn_trait_def_id, [self_ty, arguments_tuple]);
|
||||
sig.map_bound(|sig| (trait_ref, sig.output()))
|
||||
}
|
||||
|
||||
|
@ -315,8 +314,7 @@ pub fn generator_trait_ref_and_outputs<'tcx>(
|
|||
sig: ty::PolyGenSig<'tcx>,
|
||||
) -> ty::Binder<'tcx, (ty::TraitRef<'tcx>, Ty<'tcx>, Ty<'tcx>)> {
|
||||
debug_assert!(!self_ty.has_escaping_bound_vars());
|
||||
let trait_ref =
|
||||
tcx.mk_trait_ref(fn_trait_def_id, self_ty, [sig.skip_binder().resume_ty.into()]);
|
||||
let trait_ref = tcx.mk_trait_ref(fn_trait_def_id, [self_ty, sig.skip_binder().resume_ty]);
|
||||
sig.map_bound(|sig| (trait_ref, sig.yield_ty, sig.return_ty))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue