Rollup merge of #126340 - fee1-dead-contrib:fix-predicates_of-comments, r=compiler-errors

Fix outdated predacates_of.rs comments

<!--
If this PR is related to an unstable feature or an otherwise tracked effort,
please link to the relevant tracking issue here. If you don't know of a related
tracking issue or there are none, feel free to ignore this.

This PR will get automatically assigned to a reviewer. In case you would like
a specific user to review your work, you can assign it to them by using

    r​? <reviewer name>
-->
This commit is contained in:
Michael Goulet 2024-06-12 14:26:29 -04:00 committed by GitHub
commit 0d1d6ba58c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 5 deletions

View File

@ -169,12 +169,11 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Gen
predicates.insert((trait_ref.upcast(tcx), tcx.def_span(def_id)));
}
// Collect the predicates that were written inline by the user on each
// type parameter (e.g., `<T: Foo>`). Also add `ConstArgHasType` predicates
// for each const parameter.
// Add implicit predicates that should be treated as if the user has written them,
// including the implicit `T: Sized` for all generic parameters, and `ConstArgHasType`
// for const params.
for param in hir_generics.params {
match param.kind {
// We already dealt with early bound lifetimes above.
GenericParamKind::Lifetime { .. } => (),
GenericParamKind::Type { .. } => {
let param_ty = icx.lowerer().lower_ty_param(param.hir_id);
@ -204,7 +203,7 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Gen
}
trace!(?predicates);
// Add in the bounds that appear in the where-clause.
// Add inline `<T: Foo>` bounds and bounds in the where clause.
for predicate in hir_generics.predicates {
match predicate {
hir::WherePredicate::BoundPredicate(bound_pred) => {