Skip to content

Commit f14b283

Browse files
committed
Stop recording lifetimes for async.
1 parent d616fb3 commit f14b283

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

compiler/rustc_resolve/src/late.rs

-42
Original file line numberDiff line numberDiff line change
@@ -812,11 +812,6 @@ impl<'a: 'ast, 'ast> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast> {
812812
sig.decl.inputs.iter().map(|Param { ty, .. }| (None, &**ty)),
813813
&sig.decl.output,
814814
);
815-
816-
this.record_lifetime_params_for_async(
817-
fn_id,
818-
sig.header.asyncness.opt_return_id(),
819-
);
820815
},
821816
);
822817
return;
@@ -858,8 +853,6 @@ impl<'a: 'ast, 'ast> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast> {
858853
},
859854
);
860855

861-
this.record_lifetime_params_for_async(fn_id, async_node_id);
862-
863856
if let Some(body) = body {
864857
// Ignore errors in function bodies if this is rustdoc
865858
// Be sure not to set this until the function signature has been resolved.
@@ -3948,41 +3941,6 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
39483941
Some((ident.name, ns)),
39493942
)
39503943
}
3951-
3952-
/// Construct the list of in-scope lifetime parameters for async lowering.
3953-
/// We include all lifetime parameters, either named or "Fresh".
3954-
/// The order of those parameters does not matter, as long as it is
3955-
/// deterministic.
3956-
fn record_lifetime_params_for_async(
3957-
&mut self,
3958-
fn_id: NodeId,
3959-
async_node_id: Option<(NodeId, Span)>,
3960-
) {
3961-
if let Some((async_node_id, span)) = async_node_id {
3962-
let mut extra_lifetime_params =
3963-
self.r.extra_lifetime_params_map.get(&fn_id).cloned().unwrap_or_default();
3964-
for rib in self.lifetime_ribs.iter().rev() {
3965-
extra_lifetime_params.extend(
3966-
rib.bindings.iter().map(|(&ident, &(node_id, res))| (ident, node_id, res)),
3967-
);
3968-
match rib.kind {
3969-
LifetimeRibKind::Item => break,
3970-
LifetimeRibKind::AnonymousCreateParameter { binder, .. } => {
3971-
if let Some(earlier_fresh) = self.r.extra_lifetime_params_map.get(&binder) {
3972-
extra_lifetime_params.extend(earlier_fresh);
3973-
}
3974-
}
3975-
LifetimeRibKind::Generics { .. } => {}
3976-
_ => {
3977-
// We are in a function definition. We should only find `Generics`
3978-
// and `AnonymousCreateParameter` inside the innermost `Item`.
3979-
span_bug!(span, "unexpected rib kind: {:?}", rib.kind)
3980-
}
3981-
}
3982-
}
3983-
self.r.extra_lifetime_params_map.insert(async_node_id, extra_lifetime_params);
3984-
}
3985-
}
39863944
}
39873945

39883946
struct LifetimeCountVisitor<'a, 'b> {

0 commit comments

Comments
 (0)