Skip to content

Commit a119ed6

Browse files
committed
Update comment about where Ty:
We no longer move trait predicates where the self ty is a ty param to "the bounds of a ty param".
1 parent 2dde9a8 commit a119ed6

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

compiler/rustc_hir_analysis/src/collect/predicates_of.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -266,20 +266,16 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Gen
266266
match predicate.kind {
267267
hir::WherePredicateKind::BoundPredicate(bound_pred) => {
268268
let ty = icx.lowerer().lower_ty_maybe_return_type_notation(bound_pred.bounded_ty);
269-
270269
let bound_vars = tcx.late_bound_vars(predicate.hir_id);
271-
// Keep the type around in a dummy predicate, in case of no bounds.
272-
// That way, `where Ty:` is not a complete noop (see #53696) and `Ty`
273-
// is still checked for WF.
270+
271+
// This is a `where Ty:` (sic!).
274272
if bound_pred.bounds.is_empty() {
275273
if let ty::Param(_) = ty.kind() {
276-
// This is a `where T:`, which can be in the HIR from the
277-
// transformation that moves `?Sized` to `T`'s declaration.
278-
// We can skip the predicate because type parameters are
279-
// trivially WF, but also we *should*, to avoid exposing
280-
// users who never wrote `where Type:,` themselves, to
281-
// compiler/tooling bugs from not handling WF predicates.
274+
// We can skip the predicate because type parameters are trivially WF.
282275
} else {
276+
// Keep the type around in a dummy predicate. That way, it's not a complete
277+
// noop (see #53696) and `Ty` is still checked for WF.
278+
283279
let span = bound_pred.bounded_ty.span;
284280
let predicate = ty::Binder::bind_with_vars(
285281
ty::ClauseKind::WellFormed(ty.into()),

0 commit comments

Comments
 (0)