about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-04-24 11:40:46 +0200
committerGitHub <noreply@github.com>2025-04-24 11:40:46 +0200
commit1553cfa4e6ac95afd5faa14aae94aac0138e4305 (patch)
tree513891755ba4e0f5f4dd9f495b92aa94b7ed1e6a
parent984ef2c656414ad13e06d82404926d3d0bd04183 (diff)
parent1162f42b86a5a67211a7e45b40729801a61cdd6e (diff)
downloadrust-1553cfa4e6ac95afd5faa14aae94aac0138e4305.tar.gz
rust-1553cfa4e6ac95afd5faa14aae94aac0138e4305.zip
Rollup merge of #140214 - compiler-errors:remove-hack, r=lcnr
Remove comment about handling non-global where bounds with corresponding projection

This comment is no longer relevant since we only assemble rigid projections if no param-env candidates hold.

Also remove a stray comment from the old solver.

r? lcnr
-rw-r--r--compiler/rustc_next_trait_solver/src/solve/trait_goals.rs12
-rw-r--r--compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs2
2 files changed, 0 insertions, 14 deletions
diff --git a/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs b/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs
index 827853be280..3404c47bba2 100644
--- a/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs
+++ b/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs
@@ -1308,18 +1308,6 @@ where
                     return true;
                 }
 
-                // We don't consider a trait-bound global if it has a projection bound.
-                //
-                // See ui/traits/next-solver/normalization-shadowing/global-trait-with-project.rs
-                // for an example where this is necessary.
-                for p in goal.param_env.caller_bounds().iter() {
-                    if let ty::ClauseKind::Projection(proj) = p.kind().skip_binder() {
-                        if proj.projection_term.trait_ref(self.cx()) == trait_pred.trait_ref {
-                            return true;
-                        }
-                    }
-                }
-
                 false
             }
             _ => false,
diff --git a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs
index cf6d2bc151f..00101010f14 100644
--- a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs
+++ b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs
@@ -240,8 +240,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
             if !drcx.args_may_unify(obligation_args, bound_trait_ref.skip_binder().args) {
                 continue;
             }
-            // FIXME(oli-obk): it is suspicious that we are dropping the constness and
-            // polarity here.
             let wc = self.where_clause_may_apply(stack, bound_trait_ref)?;
             if wc.may_apply() {
                 candidates.vec.push(ParamCandidate(bound));