Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 79ba84f

Browse files
committed
Adjust documentation
1 parent eacebf2 commit 79ba84f

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/librustc/ty/subst.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ impl<'a, 'gcx, 'tcx> Substs<'tcx> {
179179
})
180180
}
181181

182+
/// Creates a `Substs` that maps each generic parameter to a higher-ranked
183+
/// var bound at index `0`. For types, we use a `BoundVar` index equal to
184+
/// the type parameter index. For regions, we use the `BoundRegion::BrNamed`
185+
/// variant (which has a def-id).
182186
pub fn bound_vars_for_item(
183187
tcx: TyCtxt<'a, 'gcx, 'tcx>,
184188
def_id: DefId

src/librustc_traits/lowering/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,8 @@ fn program_clauses_for_trait<'a, 'tcx>(
246246
// and that named bound regions have a def-id, it is safe
247247
// to just inject `hypotheses` (which contains named vars bound at index `0`)
248248
// into this binding level. This may change if we ever allow where clauses
249-
// to bind types (e.g. for GATs things).
249+
// to bind types (e.g. for GATs things), because bound types only use a `BoundVar`
250+
// index (no def-id).
250251
hypotheses,
251252

252253
category: ProgramClauseCategory::ImpliedBound,
@@ -368,7 +369,7 @@ pub fn program_clauses_for_type_def<'a, 'tcx>(
368369
};
369370
let well_formed_clause = Clause::ForAll(ty::Binder::bind(well_formed_clause));
370371

371-
// Rule FromEnv-Type
372+
// Rule Implied-Bound-From-Type
372373
//
373374
// For each where clause `WC`:
374375
// ```
@@ -409,7 +410,7 @@ pub fn program_clauses_for_associated_type_def<'a, 'tcx>(
409410
tcx: TyCtxt<'a, 'tcx, 'tcx>,
410411
item_id: DefId,
411412
) -> Clauses<'tcx> {
412-
// Rule ProjectionEq-Skolemize
413+
// Rule ProjectionEq-Placeholder
413414
//
414415
// ```
415416
// trait Trait<P1..Pn> {

0 commit comments

Comments
 (0)