File tree 1 file changed +4
-1
lines changed
compiler/rustc_trait_selection/src/solve 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ pub(super) enum CandidateSource {
79
79
AliasBound ( usize ) ,
80
80
}
81
81
82
- pub ( super ) trait GoalKind < ' tcx > : TypeFoldable < ' tcx > + Copy {
82
+ pub ( super ) trait GoalKind < ' tcx > : TypeFoldable < ' tcx > + Copy + Eq {
83
83
fn self_ty ( self ) -> Ty < ' tcx > ;
84
84
85
85
fn with_self_ty ( self , tcx : TyCtxt < ' tcx > , self_ty : Ty < ' tcx > ) -> Self ;
@@ -124,6 +124,8 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
124
124
& mut self ,
125
125
goal : Goal < ' tcx , G > ,
126
126
) -> Vec < Candidate < ' tcx > > {
127
+ debug_assert_eq ! ( goal, self . infcx. resolve_vars_if_possible( goal) ) ;
128
+
127
129
// HACK: `_: Trait` is ambiguous, because it may be satisfied via a builtin rule,
128
130
// object bound, alias bound, etc. We are unable to determine this until we can at
129
131
// least structually resolve the type one layer.
@@ -179,6 +181,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
179
181
Ok ( ( _, certainty) ) => certainty,
180
182
Err ( NoSolution ) => return ,
181
183
} ;
184
+ let normalized_ty = self . infcx . resolve_vars_if_possible ( normalized_ty) ;
182
185
183
186
// NOTE: Alternatively we could call `evaluate_goal` here and only have a `Normalized` candidate.
184
187
// This doesn't work as long as we use `CandidateSource` in winnowing.
You can’t perform that action at this time.
0 commit comments