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