Skip to content

Commit 3f7db37

Browse files
committed
captures -> collected_lifetimes
1 parent 12fa339 commit 3f7db37

File tree

1 file changed

+10
-9
lines changed
  • compiler/rustc_ast_lowering/src

1 file changed

+10
-9
lines changed

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1768,7 +1768,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
17681768

17691769
// Contains the new lifetime definitions created for the TAIT (if any) generated for the
17701770
// return type.
1771-
let mut captures = Vec::new();
1771+
let mut collected_lifetimes = Vec::new();
17721772
let mut new_remapping = FxHashMap::default();
17731773

17741774
let extra_lifetime_params = self.resolver.take_extra_lifetime_params(opaque_ty_node_id);
@@ -1804,10 +1804,10 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
18041804
};
18051805

18061806
let lifetime = Lifetime { id: outer_node_id, ident };
1807-
captures.push((inner_node_id, lifetime, Some(inner_res)));
1807+
collected_lifetimes.push((inner_node_id, lifetime, Some(inner_res)));
18081808
}
18091809

1810-
debug!(?captures);
1810+
debug!(?collected_lifetimes);
18111811

18121812
// We only want to capture the lifetimes that appear in the bounds. So visit the bounds to
18131813
// find out exactly which ones those are.
@@ -1820,7 +1820,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
18201820
// If this opaque type is only capturing a subset of the lifetimes (those that appear
18211821
// in bounds), then create the new lifetime parameters required and create a mapping
18221822
// from the old `'a` (on the function) to the new `'a` (on the opaque type).
1823-
captures.extend(
1823+
collected_lifetimes.extend(
18241824
this.create_lifetime_defs(
18251825
opaque_ty_def_id,
18261826
&lifetimes_to_remap,
@@ -1829,7 +1829,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
18291829
.into_iter()
18301830
.map(|(new_node_id, lifetime)| (new_node_id, lifetime, None)),
18311831
);
1832-
debug!(?captures);
1832+
debug!(?collected_lifetimes);
18331833
debug!(?new_remapping);
18341834

18351835
// Install the remapping from old to new (if any):
@@ -1845,7 +1845,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
18451845
let future_bound =
18461846
this.lower_async_fn_output_type_to_future_bound(output, fn_def_id, span);
18471847

1848-
let generic_params = this.arena.alloc_from_iter(captures.iter().map(
1848+
let generic_params = this.arena.alloc_from_iter(collected_lifetimes.iter().map(
18491849
|&(new_node_id, lifetime, _)| {
18501850
let hir_id = this.lower_node_id(new_node_id);
18511851
debug_assert_ne!(this.opt_local_def_id(new_node_id), None);
@@ -1903,8 +1903,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
19031903
//
19041904
// For the "output" lifetime parameters, we just want to
19051905
// generate `'_`.
1906-
let generic_args =
1907-
self.arena.alloc_from_iter(captures.into_iter().map(|(_, lifetime, res)| {
1906+
let generic_args = self.arena.alloc_from_iter(collected_lifetimes.into_iter().map(
1907+
|(_, lifetime, res)| {
19081908
let id = self.next_node_id();
19091909
let span = lifetime.ident.span;
19101910

@@ -1919,7 +1919,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
19191919
);
19201920
let l = self.new_named_lifetime_with_res(id, span, ident, res);
19211921
hir::GenericArg::Lifetime(l)
1922-
}));
1922+
},
1923+
));
19231924

19241925
// Create the `Foo<...>` reference itself. Note that the `type
19251926
// Foo = impl Trait` is, internally, created as a child of the

0 commit comments

Comments
 (0)