Rename some more coro_kind -> coroutine_kind
This commit is contained in:
parent
d5dcd85376
commit
384a49edd0
3 changed files with 9 additions and 8 deletions
|
@ -1271,11 +1271,11 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
|
||||||
// Functions cannot both be `const async` or `const gen`
|
// Functions cannot both be `const async` or `const gen`
|
||||||
if let Some(&FnHeader {
|
if let Some(&FnHeader {
|
||||||
constness: Const::Yes(cspan),
|
constness: Const::Yes(cspan),
|
||||||
coroutine_kind: Some(coro_kind),
|
coroutine_kind: Some(coroutine_kind),
|
||||||
..
|
..
|
||||||
}) = fk.header()
|
}) = fk.header()
|
||||||
{
|
{
|
||||||
let aspan = match coro_kind {
|
let aspan = match coroutine_kind {
|
||||||
CoroutineKind::Async { span: aspan, .. }
|
CoroutineKind::Async { span: aspan, .. }
|
||||||
| CoroutineKind::Gen { span: aspan, .. }
|
| CoroutineKind::Gen { span: aspan, .. }
|
||||||
| CoroutineKind::AsyncGen { span: aspan, .. } => aspan,
|
| CoroutineKind::AsyncGen { span: aspan, .. } => aspan,
|
||||||
|
|
|
@ -541,8 +541,8 @@ fn check_test_signature(
|
||||||
return Err(sd.emit_err(errors::TestBadFn { span: i.span, cause: span, kind: "unsafe" }));
|
return Err(sd.emit_err(errors::TestBadFn { span: i.span, cause: span, kind: "unsafe" }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(coro_kind) = f.sig.header.coroutine_kind {
|
if let Some(coroutine_kind) = f.sig.header.coroutine_kind {
|
||||||
match coro_kind {
|
match coroutine_kind {
|
||||||
ast::CoroutineKind::Async { span, .. } => {
|
ast::CoroutineKind::Async { span, .. } => {
|
||||||
return Err(sd.emit_err(errors::TestBadFn {
|
return Err(sd.emit_err(errors::TestBadFn {
|
||||||
span: i.span,
|
span: i.span,
|
||||||
|
|
|
@ -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
|
// Explicitly check for lints associated with 'closure_id', since
|
||||||
// it does not have a corresponding AST node
|
// it does not have a corresponding AST node
|
||||||
if let ast_visit::FnKind::Fn(_, _, sig, _, _, _) = fk {
|
if let ast_visit::FnKind::Fn(_, _, sig, _, _, _) = fk {
|
||||||
if let Some(coro_kind) = sig.header.coroutine_kind {
|
if let Some(coroutine_kind) = sig.header.coroutine_kind {
|
||||||
self.check_id(coro_kind.closure_id());
|
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
|
// it does not have a corresponding AST node
|
||||||
match e.kind {
|
match e.kind {
|
||||||
ast::ExprKind::Closure(box ast::Closure {
|
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());
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue