@@ -77,10 +77,10 @@ pub fn overlapping_impls(
77
77
// a quick check via fast_reject to tell if the impl headers could possibly
78
78
// unify.
79
79
let drcx = DeepRejectCtxt { treat_obligation_params : TreatParams :: AsInfer } ;
80
- let impl1_ref = tcx. impl_trait_ref ( impl1_def_id) . map ( ty :: EarlyBinder :: subst_identity ) ;
81
- let impl2_ref = tcx. impl_trait_ref ( impl2_def_id) . map ( ty :: EarlyBinder :: subst_identity ) ;
80
+ let impl1_ref = tcx. impl_trait_ref ( impl1_def_id) ;
81
+ let impl2_ref = tcx. impl_trait_ref ( impl2_def_id) ;
82
82
let may_overlap = match ( impl1_ref, impl2_ref) {
83
- ( Some ( a) , Some ( b) ) => iter:: zip ( a. substs , b. substs )
83
+ ( Some ( a) , Some ( b) ) => iter:: zip ( a. skip_binder ( ) . substs , b. skip_binder ( ) . substs )
84
84
. all ( |( arg1, arg2) | drcx. generic_args_may_unify ( arg1, arg2) ) ,
85
85
( None , None ) => {
86
86
let self_ty1 = tcx. type_of ( impl1_def_id) ;
@@ -461,7 +461,7 @@ pub fn orphan_check(tcx: TyCtxt<'_>, impl_def_id: DefId) -> Result<(), OrphanChe
461
461
462
462
// We only except this routine to be invoked on implementations
463
463
// of a trait, not inherent implementations.
464
- let trait_ref = tcx. impl_trait_ref ( impl_def_id) . unwrap ( ) . skip_binder ( ) ;
464
+ let trait_ref = tcx. impl_trait_ref ( impl_def_id) . unwrap ( ) . subst_identity ( ) ;
465
465
debug ! ( "orphan_check: trait_ref={:?}" , trait_ref) ;
466
466
467
467
// If the *trait* is local to the crate, ok.
0 commit comments