Skip to content

Commit

Permalink
Really fix early lints inside an async desugaring
Browse files Browse the repository at this point in the history
  • Loading branch information
Jethro Beekman committed Feb 3, 2021
1 parent e6a0f3c commit 37cb9d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 4 additions & 4 deletions compiler/rustc_lint/src/early.rs
Expand Up @@ -219,10 +219,10 @@ 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::ExprKind::Closure(_, asyncness, ..) = e.kind {
if let ast::Async::Yes { closure_id, .. } = asyncness {
self.check_id(closure_id);
}
match e.kind {
ast::ExprKind::Closure(_, ast::Async::Yes { closure_id, .. }, ..)
| ast::ExprKind::Async(_, closure_id, ..) => self.check_id(closure_id),
_ => {}
}
}

Expand Down
Expand Up @@ -33,4 +33,9 @@ fn main() {
fn inner() {
let _ = foo!(third);
}

#[allow(semicolon_in_expressions_from_macros)]
async {
let _ = foo!(fourth);
};
}

0 comments on commit 37cb9d3

Please sign in to comment.