@@ -807,26 +807,26 @@ impl<'a,'tcx> ProbeContext<'a,'tcx> {
807807 match probe. kind {
808808 InherentImplCandidate ( impl_def_id, ref substs) |
809809 ExtensionImplCandidate ( impl_def_id, _, ref substs, _) => {
810+ let selcx = & mut traits:: SelectionContext :: new ( self . infcx ( ) , self . fcx ) ;
811+ let cause = traits:: ObligationCause :: misc ( self . span , self . fcx . body_id ) ;
812+
810813 // Check whether the impl imposes obligations we have to worry about.
811814 let impl_generics = ty:: lookup_item_type ( self . tcx ( ) , impl_def_id) . generics ;
812815 let impl_bounds = impl_generics. to_bounds ( self . tcx ( ) , substs) ;
813- // FIXME(#20378) assoc type normalization here?
814-
815- // Erase any late-bound regions bound in the impl
816- // which appear in the bounds.
817- let impl_bounds = self . erase_late_bound_regions ( & ty:: Binder ( impl_bounds) ) ;
816+ let traits:: Normalized { value : impl_bounds,
817+ obligations : norm_obligations } =
818+ traits:: normalize ( selcx, cause. clone ( ) , & impl_bounds) ;
818819
819820 // Convert the bounds into obligations.
820821 let obligations =
821- traits:: predicates_for_generics (
822- self . tcx ( ) ,
823- traits:: ObligationCause :: misc ( self . span , self . fcx . body_id ) ,
824- & impl_bounds) ;
822+ traits:: predicates_for_generics ( self . tcx ( ) ,
823+ cause. clone ( ) ,
824+ & impl_bounds) ;
825825 debug ! ( "impl_obligations={}" , obligations. repr( self . tcx( ) ) ) ;
826826
827827 // Evaluate those obligations to see if they might possibly hold.
828- let mut selcx = traits :: SelectionContext :: new ( self . infcx ( ) , self . fcx ) ;
829- obligations . all ( |o| selcx. evaluate_obligation ( o) )
828+ obligations . all ( |o| selcx. evaluate_obligation ( o ) ) &&
829+ norm_obligations . iter ( ) . all ( |o| selcx. evaluate_obligation ( o) )
830830 }
831831
832832 ObjectCandidate ( ..) |
0 commit comments