This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
compiler/rustc_trait_selection/src/solve Expand file tree Collapse file tree 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> {
296296 goal : Goal < ' tcx , Self > ,
297297 assumption : ty:: Predicate < ' tcx > ,
298298 ) -> 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+ {
300302 ecx. infcx . probe ( |_| {
301303 let assumption_projection_pred =
302304 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> {
6565 goal : Goal < ' tcx , Self > ,
6666 assumption : ty:: Predicate < ' tcx > ,
6767 ) -> 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+ {
6971 // FIXME: Constness and polarity
7072 ecx. infcx . probe ( |_| {
7173 let assumption_trait_pred =
You can’t perform that action at this time.
0 commit comments