mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
feat: Implement diagnostic for await
outside of async
This commit is contained in:
parent
aa00ddcf65
commit
8a51419a2d
6 changed files with 187 additions and 17 deletions
|
@ -48,6 +48,7 @@ macro_rules! diagnostics {
|
|||
// ]
|
||||
|
||||
diagnostics![
|
||||
AwaitOutsideOfAsync,
|
||||
BreakOutsideOfLoop,
|
||||
ExpectedFunction,
|
||||
InactiveCode,
|
||||
|
@ -135,6 +136,12 @@ pub struct UnreachableLabel {
|
|||
pub name: Name,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct AwaitOutsideOfAsync {
|
||||
pub node: InFile<AstPtr<ast::AwaitExpr>>,
|
||||
pub location: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
||||
pub struct UndeclaredLabel {
|
||||
pub node: InFile<AstPtr<ast::Lifetime>>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue