@@ -177,8 +177,8 @@ pub(crate) enum RibKind<'a> {
177177 /// upvars).
178178 AssocItem ,
179179
180- /// We passed through a closure. Disallow labels.
181- ClosureOrAsync ,
180+ /// We passed through a function, closure or coroutine signature . Disallow labels.
181+ FnOrCoroutine ,
182182
183183 /// We passed through an item scope. Disallow upvars.
184184 Item ( HasGenericParams ) ,
@@ -215,7 +215,7 @@ impl RibKind<'_> {
215215 pub ( crate ) fn contains_params ( & self ) -> bool {
216216 match self {
217217 RibKind :: Normal
218- | RibKind :: ClosureOrAsync
218+ | RibKind :: FnOrCoroutine
219219 | RibKind :: ConstantItem ( ..)
220220 | RibKind :: Module ( _)
221221 | RibKind :: MacroDefinition ( _)
@@ -231,7 +231,7 @@ impl RibKind<'_> {
231231 RibKind :: Normal | RibKind :: MacroDefinition ( ..) => false ,
232232
233233 RibKind :: AssocItem
234- | RibKind :: ClosureOrAsync
234+ | RibKind :: FnOrCoroutine
235235 | RibKind :: Item ( ..)
236236 | RibKind :: ConstantItem ( ..)
237237 | RibKind :: Module ( ..)
@@ -924,9 +924,9 @@ impl<'a: 'ast, 'ast, 'tcx> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast,
924924 debug ! ( "(resolving function) entering function" ) ;
925925
926926 // Create a value rib for the function.
927- self . with_rib ( ValueNS , RibKind :: ClosureOrAsync , |this| {
927+ self . with_rib ( ValueNS , RibKind :: FnOrCoroutine , |this| {
928928 // Create a label rib for the function.
929- this. with_label_rib ( RibKind :: ClosureOrAsync , |this| {
929+ this. with_label_rib ( RibKind :: FnOrCoroutine , |this| {
930930 match fn_kind {
931931 FnKind :: Fn ( _, _, sig, _, generics, body) => {
932932 this. visit_generics ( generics) ;
@@ -4287,7 +4287,7 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
42874287 ..
42884288 } ) => {
42894289 self . with_rib ( ValueNS , RibKind :: Normal , |this| {
4290- this. with_label_rib ( RibKind :: ClosureOrAsync , |this| {
4290+ this. with_label_rib ( RibKind :: FnOrCoroutine , |this| {
42914291 // Resolve arguments:
42924292 this. resolve_params ( & fn_decl. inputs ) ;
42934293 // No need to resolve return type --
@@ -4304,7 +4304,7 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
43044304 } )
43054305 } ) ;
43064306 }
4307- // For closures, ClosureOrAsyncRibKind is added in visit_fn
4307+ // For closures, RibKind::FnOrCoroutine is added in visit_fn
43084308 ExprKind :: Closure ( box ast:: Closure {
43094309 binder : ClosureBinder :: For { ref generic_params, span } ,
43104310 ..
@@ -4322,7 +4322,7 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
43224322 }
43234323 ExprKind :: Closure ( ..) => visit:: walk_expr ( self , expr) ,
43244324 ExprKind :: Gen ( ..) => {
4325- self . with_label_rib ( RibKind :: ClosureOrAsync , |this| visit:: walk_expr ( this, expr) ) ;
4325+ self . with_label_rib ( RibKind :: FnOrCoroutine , |this| visit:: walk_expr ( this, expr) ) ;
43264326 }
43274327 ExprKind :: Repeat ( ref elem, ref ct) => {
43284328 self . visit_expr ( elem) ;
0 commit comments