@@ -267,20 +267,16 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Gen
267
267
match predicate. kind {
268
268
hir:: WherePredicateKind :: BoundPredicate ( bound_pred) => {
269
269
let ty = icx. lowerer ( ) . lower_ty_maybe_return_type_notation ( bound_pred. bounded_ty ) ;
270
-
271
270
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!).
275
273
if bound_pred. bounds . is_empty ( ) {
276
274
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.
283
276
} 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
+
284
280
let span = bound_pred. bounded_ty . span ;
285
281
let predicate = ty:: Binder :: bind_with_vars (
286
282
ty:: ClauseKind :: WellFormed ( ty. into ( ) ) ,
0 commit comments