@@ -399,19 +399,15 @@ where
399399 return ( candidates, failed_candidate_info) ;
400400 } ;
401401
402+ let goal: Goal < I , G > = goal
403+ . with ( self . cx ( ) , goal. predicate . with_replaced_self_ty ( self . cx ( ) , normalized_self_ty) ) ;
404+
402405 if normalized_self_ty. is_ty_var ( ) {
403406 debug ! ( "self type has been normalized to infer" ) ;
404- self . try_assemble_bounds_via_registered_opaque (
405- goal,
406- normalized_self_ty,
407- & mut candidates,
408- ) ;
407+ self . try_assemble_bounds_via_registered_opaque ( goal, & mut candidates) ;
409408 return ( candidates, failed_candidate_info) ;
410409 }
411410
412- let goal: Goal < I , G > = goal
413- . with ( self . cx ( ) , goal. predicate . with_replaced_self_ty ( self . cx ( ) , normalized_self_ty) ) ;
414-
415411 // Vars that show up in the rest of the goal substs may have been constrained by
416412 // normalizing the self type as well, since type variables are not uniquified.
417413 let goal = self . resolve_vars_if_possible ( goal) ;
@@ -959,9 +955,9 @@ where
959955 fn try_assemble_bounds_via_registered_opaque < G : GoalKind < D > > (
960956 & mut self ,
961957 goal : Goal < I , G > ,
962- self_ty : I :: Ty ,
963958 candidates : & mut Vec < Candidate < I > > ,
964959 ) {
960+ let self_ty = goal. predicate . self_ty ( ) ;
965961 let mut is_hidden_type_of_alias = false ;
966962 for alias_ty in self . find_sup_as_registered_opaque ( self_ty) {
967963 is_hidden_type_of_alias = true ;
0 commit comments