@@ -177,8 +177,8 @@ pub(crate) enum RibKind<'a> {
177
177
/// upvars).
178
178
AssocItem ,
179
179
180
- /// We passed through a closure. Disallow labels.
181
- ClosureOrAsync ,
180
+ /// We passed through a function, closure or coroutine signature . Disallow labels.
181
+ FnOrCoroutine ,
182
182
183
183
/// We passed through an item scope. Disallow upvars.
184
184
Item ( HasGenericParams ) ,
@@ -215,7 +215,7 @@ impl RibKind<'_> {
215
215
pub ( crate ) fn contains_params ( & self ) -> bool {
216
216
match self {
217
217
RibKind :: Normal
218
- | RibKind :: ClosureOrAsync
218
+ | RibKind :: FnOrCoroutine
219
219
| RibKind :: ConstantItem ( ..)
220
220
| RibKind :: Module ( _)
221
221
| RibKind :: MacroDefinition ( _)
@@ -231,7 +231,7 @@ impl RibKind<'_> {
231
231
RibKind :: Normal | RibKind :: MacroDefinition ( ..) => false ,
232
232
233
233
RibKind :: AssocItem
234
- | RibKind :: ClosureOrAsync
234
+ | RibKind :: FnOrCoroutine
235
235
| RibKind :: Item ( ..)
236
236
| RibKind :: ConstantItem ( ..)
237
237
| RibKind :: Module ( ..)
@@ -924,9 +924,9 @@ impl<'a: 'ast, 'ast, 'tcx> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast,
924
924
debug ! ( "(resolving function) entering function" ) ;
925
925
926
926
// Create a value rib for the function.
927
- self . with_rib ( ValueNS , RibKind :: ClosureOrAsync , |this| {
927
+ self . with_rib ( ValueNS , RibKind :: FnOrCoroutine , |this| {
928
928
// Create a label rib for the function.
929
- this. with_label_rib ( RibKind :: ClosureOrAsync , |this| {
929
+ this. with_label_rib ( RibKind :: FnOrCoroutine , |this| {
930
930
match fn_kind {
931
931
FnKind :: Fn ( _, _, sig, _, generics, body) => {
932
932
this. visit_generics ( generics) ;
@@ -4287,7 +4287,7 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
4287
4287
..
4288
4288
} ) => {
4289
4289
self . with_rib ( ValueNS , RibKind :: Normal , |this| {
4290
- this. with_label_rib ( RibKind :: ClosureOrAsync , |this| {
4290
+ this. with_label_rib ( RibKind :: FnOrCoroutine , |this| {
4291
4291
// Resolve arguments:
4292
4292
this. resolve_params ( & fn_decl. inputs ) ;
4293
4293
// No need to resolve return type --
@@ -4304,7 +4304,7 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
4304
4304
} )
4305
4305
} ) ;
4306
4306
}
4307
- // For closures, ClosureOrAsyncRibKind is added in visit_fn
4307
+ // For closures, RibKind::FnOrCoroutine is added in visit_fn
4308
4308
ExprKind :: Closure ( box ast:: Closure {
4309
4309
binder : ClosureBinder :: For { ref generic_params, span } ,
4310
4310
..
@@ -4322,7 +4322,7 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
4322
4322
}
4323
4323
ExprKind :: Closure ( ..) => visit:: walk_expr ( self , expr) ,
4324
4324
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) ) ;
4326
4326
}
4327
4327
ExprKind :: Repeat ( ref elem, ref ct) => {
4328
4328
self . visit_expr ( elem) ;
0 commit comments