@@ -807,26 +807,26 @@ impl<'a,'tcx> ProbeContext<'a,'tcx> {
807
807
match probe. kind {
808
808
InherentImplCandidate ( impl_def_id, ref substs) |
809
809
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
+
810
813
// Check whether the impl imposes obligations we have to worry about.
811
814
let impl_generics = ty:: lookup_item_type ( self . tcx ( ) , impl_def_id) . generics ;
812
815
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) ;
818
819
819
820
// Convert the bounds into obligations.
820
821
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) ;
825
825
debug ! ( "impl_obligations={}" , obligations. repr( self . tcx( ) ) ) ;
826
826
827
827
// 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) )
830
830
}
831
831
832
832
ObjectCandidate ( ..) |
0 commit comments