Skip to content

Commit acb50d5

Browse files
committed
Add comment on creation of lifetime inside opaque types
1 parent 9f8c6d5 commit acb50d5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1469,6 +1469,10 @@ impl<'a, 'tcx> BoundVarContext<'a, 'tcx> {
14691469
for &(opaque_def_id, captures) in opaque_capture_scopes.iter().rev() {
14701470
let mut captures = captures.borrow_mut();
14711471
let remapped = *captures.entry(lifetime).or_insert_with(|| {
1472+
// `opaque_def_id` is unique to the `BoundVarContext` pass which is executed once
1473+
// per `resolve_bound_vars` query. This is the only location that creates nested
1474+
// lifetime inside a opaque type. `<opaque_def_id>::LifetimeNs(..)` is thus unique
1475+
// to this query and duplicates within the query are handled by `self.disambiguator`.
14721476
let feed = self.tcx.create_def(
14731477
opaque_def_id,
14741478
Some(ident.name),

0 commit comments

Comments
 (0)