Skip to content

Commit 1553cfa

Browse files
authored
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
2 parents 984ef2c + 1162f42 commit 1553cfa

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

compiler/rustc_next_trait_solver/src/solve/trait_goals.rs

-12
Original file line numberDiff line numberDiff line change
@@ -1308,18 +1308,6 @@ where
13081308
return true;
13091309
}
13101310

1311-
// We don't consider a trait-bound global if it has a projection bound.
1312-
//
1313-
// See ui/traits/next-solver/normalization-shadowing/global-trait-with-project.rs
1314-
// for an example where this is necessary.
1315-
for p in goal.param_env.caller_bounds().iter() {
1316-
if let ty::ClauseKind::Projection(proj) = p.kind().skip_binder() {
1317-
if proj.projection_term.trait_ref(self.cx()) == trait_pred.trait_ref {
1318-
return true;
1319-
}
1320-
}
1321-
}
1322-
13231311
false
13241312
}
13251313
_ => false,

compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs

-2
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
240240
if !drcx.args_may_unify(obligation_args, bound_trait_ref.skip_binder().args) {
241241
continue;
242242
}
243-
// FIXME(oli-obk): it is suspicious that we are dropping the constness and
244-
// polarity here.
245243
let wc = self.where_clause_may_apply(stack, bound_trait_ref)?;
246244
if wc.may_apply() {
247245
candidates.vec.push(ParamCandidate(bound));

0 commit comments

Comments
 (0)