diff options
| author | Eric Holk <ericholk@microsoft.com> | 2023-11-30 14:54:39 -0800 |
|---|---|---|
| committer | Eric Holk <ericholk@microsoft.com> | 2023-12-04 12:48:01 -0800 |
| commit | 48d5f1f0f26b78f76c5fcf0dda5ac93b8754aeb6 (patch) | |
| tree | 09280f2a00a4e2fd4e7a8f3a3c49062239a64409 /compiler/rustc_lint/src/early.rs | |
| parent | 3887b1645aaa85e2755a54ab91f40c4fedc1dc0f (diff) | |
| download | rust-48d5f1f0f26b78f76c5fcf0dda5ac93b8754aeb6.tar.gz rust-48d5f1f0f26b78f76c5fcf0dda5ac93b8754aeb6.zip | |
Merge Async and Gen into CoroutineKind
Diffstat (limited to 'compiler/rustc_lint/src/early.rs')
| -rw-r--r-- | compiler/rustc_lint/src/early.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_lint/src/early.rs b/compiler/rustc_lint/src/early.rs index 4cccaeeca84..41fbf1f3e2c 100644 --- a/compiler/rustc_lint/src/early.rs +++ b/compiler/rustc_lint/src/early.rs @@ -162,7 +162,9 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T> // Explicitly check for lints associated with 'closure_id', since // it does not have a corresponding AST node if let ast_visit::FnKind::Fn(_, _, sig, _, _, _) = fk { - if let ast::Async::Yes { closure_id, .. } = sig.header.asyncness { + if let ast::CoroutineKind::Async { closure_id, .. } + | ast::CoroutineKind::Gen { closure_id, .. } = sig.header.coro_kind + { self.check_id(closure_id); } } @@ -223,7 +225,9 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T> // it does not have a corresponding AST node match e.kind { ast::ExprKind::Closure(box ast::Closure { - asyncness: ast::Async::Yes { closure_id, .. }, + coro_kind: + ast::CoroutineKind::Async { closure_id, .. } + | ast::CoroutineKind::Gen { closure_id, .. }, .. }) => self.check_id(closure_id), _ => {} |
