File tree 2 files changed +6
-2
lines changed
compiler/rustc_trait_selection/src/solve
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -296,7 +296,9 @@ impl<'tcx> assembly::GoalKind<'tcx> for ProjectionPredicate<'tcx> {
296
296
goal : Goal < ' tcx , Self > ,
297
297
assumption : ty:: Predicate < ' tcx > ,
298
298
) -> QueryResult < ' tcx > {
299
- if let Some ( poly_projection_pred) = assumption. to_opt_poly_projection_pred ( ) {
299
+ if let Some ( poly_projection_pred) = assumption. to_opt_poly_projection_pred ( )
300
+ && poly_projection_pred. projection_def_id ( ) == goal. predicate . def_id ( )
301
+ {
300
302
ecx. infcx . probe ( |_| {
301
303
let assumption_projection_pred =
302
304
ecx. infcx . instantiate_bound_vars_with_infer ( poly_projection_pred) ;
Original file line number Diff line number Diff line change @@ -65,7 +65,9 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
65
65
goal : Goal < ' tcx , Self > ,
66
66
assumption : ty:: Predicate < ' tcx > ,
67
67
) -> QueryResult < ' tcx > {
68
- if let Some ( poly_trait_pred) = assumption. to_opt_poly_trait_pred ( ) {
68
+ if let Some ( poly_trait_pred) = assumption. to_opt_poly_trait_pred ( )
69
+ && poly_trait_pred. def_id ( ) == goal. predicate . def_id ( )
70
+ {
69
71
// FIXME: Constness and polarity
70
72
ecx. infcx . probe ( |_| {
71
73
let assumption_trait_pred =
You can’t perform that action at this time.
0 commit comments