Rename some more coro_kind -> coroutine_kind

This commit is contained in:
Michael Goulet 2023-12-08 21:46:30 +00:00
parent d5dcd85376
commit 384a49edd0
3 changed files with 9 additions and 8 deletions

View File

@ -1271,11 +1271,11 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
// Functions cannot both be `const async` or `const gen`
if let Some(&FnHeader {
constness: Const::Yes(cspan),
coroutine_kind: Some(coro_kind),
coroutine_kind: Some(coroutine_kind),
..
}) = fk.header()
{
let aspan = match coro_kind {
let aspan = match coroutine_kind {
CoroutineKind::Async { span: aspan, .. }
| CoroutineKind::Gen { span: aspan, .. }
| CoroutineKind::AsyncGen { span: aspan, .. } => aspan,

View File

@ -541,8 +541,8 @@ fn check_test_signature(
return Err(sd.emit_err(errors::TestBadFn { span: i.span, cause: span, kind: "unsafe" }));
}
if let Some(coro_kind) = f.sig.header.coroutine_kind {
match coro_kind {
if let Some(coroutine_kind) = f.sig.header.coroutine_kind {
match coroutine_kind {
ast::CoroutineKind::Async { span, .. } => {
return Err(sd.emit_err(errors::TestBadFn {
span: i.span,

View File

@ -162,8 +162,8 @@ 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 Some(coro_kind) = sig.header.coroutine_kind {
self.check_id(coro_kind.closure_id());
if let Some(coroutine_kind) = sig.header.coroutine_kind {
self.check_id(coroutine_kind.closure_id());
}
}
}
@ -223,9 +223,10 @@ 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 {
coroutine_kind: Some(coro_kind), ..
coroutine_kind: Some(coroutine_kind),
..
}) => {
self.check_id(coro_kind.closure_id());
self.check_id(coroutine_kind.closure_id());
}
_ => {}
}