@@ -121,24 +121,21 @@ where
121121 alias_term : AliasTerm < I > ,
122122 has_escaping : HasEscapingBoundVars ,
123123 ) -> Result < Option < I :: Term > , NoSolution > {
124- let current_universe = self . infcx . universe ( ) ;
125- self . infcx . create_next_universe ( ) ;
126-
127124 let ( normalized, ambig_goal) = ( self . normalize ) ( alias_term) ?;
128125
129126 // Return ambiguous higher ranked alias as is, if
130127 // - it contains escaping vars, and
131- // - the normalized term contains infer vars newly created
132- // in the normalization above.
133- // The problem is that they may be resolved to types
134- // referencing the temporary placeholders.
128+ // - the normalized term contains infer vars which may mention
129+ // temporary placeholders after we've already mapped them back
130+ // to bound vars.
135131 //
136- // We can normalize the ambiguous alias again after the binder is instantiated.
132+ // We can normalize the ambiguous alias again after the binder is instantiated
133+ // or once we've made further inference progress.
137134 if ambig_goal. is_some ( ) && has_escaping == HasEscapingBoundVars :: Yes {
138135 let mut visitor = MaxUniverse :: new ( self . infcx ) ;
139136 normalized. visit_with ( & mut visitor) ;
140137 let max_universe = visitor. max_universe ( ) ;
141- if current_universe . cannot_name ( max_universe ) {
138+ if max_universe . can_name ( self . universes . first ( ) . unwrap ( ) . unwrap ( ) ) {
142139 return Ok ( None ) ;
143140 }
144141 }
0 commit comments