Skip to content

Commit 0d1d6ba

Browse files
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> -->
2 parents 754b26d + 54429cf commit 0d1d6ba

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

compiler/rustc_hir_analysis/src/collect/predicates_of.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,11 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Gen
169169
predicates.insert((trait_ref.upcast(tcx), tcx.def_span(def_id)));
170170
}
171171

172-
// Collect the predicates that were written inline by the user on each
173-
// type parameter (e.g., `<T: Foo>`). Also add `ConstArgHasType` predicates
174-
// for each const parameter.
172+
// Add implicit predicates that should be treated as if the user has written them,
173+
// including the implicit `T: Sized` for all generic parameters, and `ConstArgHasType`
174+
// for const params.
175175
for param in hir_generics.params {
176176
match param.kind {
177-
// We already dealt with early bound lifetimes above.
178177
GenericParamKind::Lifetime { .. } => (),
179178
GenericParamKind::Type { .. } => {
180179
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
204203
}
205204

206205
trace!(?predicates);
207-
// Add in the bounds that appear in the where-clause.
206+
// Add inline `<T: Foo>` bounds and bounds in the where clause.
208207
for predicate in hir_generics.predicates {
209208
match predicate {
210209
hir::WherePredicate::BoundPredicate(bound_pred) => {

0 commit comments

Comments
 (0)