@@ -77,10 +77,10 @@ pub fn overlapping_impls(
7777 // a quick check via fast_reject to tell if the impl headers could possibly
7878 // unify.
7979 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) ;
8282 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 )
8484 . all ( |( arg1, arg2) | drcx. generic_args_may_unify ( arg1, arg2) ) ,
8585 ( None , None ) => {
8686 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
461461
462462 // We only except this routine to be invoked on implementations
463463 // 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 ( ) ;
465465 debug ! ( "orphan_check: trait_ref={:?}" , trait_ref) ;
466466
467467 // If the *trait* is local to the crate, ok.
0 commit comments