@@ -812,11 +812,6 @@ impl<'a: 'ast, 'ast> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast> {
812
812
sig. decl . inputs . iter ( ) . map ( |Param { ty, .. } | ( None , & * * ty) ) ,
813
813
& sig. decl . output ,
814
814
) ;
815
-
816
- this. record_lifetime_params_for_async (
817
- fn_id,
818
- sig. header . asyncness . opt_return_id ( ) ,
819
- ) ;
820
815
} ,
821
816
) ;
822
817
return ;
@@ -858,8 +853,6 @@ impl<'a: 'ast, 'ast> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast> {
858
853
} ,
859
854
) ;
860
855
861
- this. record_lifetime_params_for_async ( fn_id, async_node_id) ;
862
-
863
856
if let Some ( body) = body {
864
857
// Ignore errors in function bodies if this is rustdoc
865
858
// 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> {
3948
3941
Some ( ( ident. name , ns) ) ,
3949
3942
)
3950
3943
}
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
- }
3986
3944
}
3987
3945
3988
3946
struct LifetimeCountVisitor < ' a , ' b > {
0 commit comments