Skip to content

Commit

Permalink
Unrolled build for rust-lang#126340
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#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>
-->
  • Loading branch information
rust-timer committed Jun 12, 2024
2 parents c25ac9d + 54429cf commit ca6b095
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions compiler/rustc_hir_analysis/src/collect/predicates_of.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit ca6b095

Please sign in to comment.