1
Fork 0

Auto merge of #101562 - nnethercote:shrink-ast-Expr-harder, r=petrochenkov

Shrink `ast::Expr` harder

r? `@ghost`
This commit is contained in:
bors 2022-11-18 16:56:12 +00:00
commit 70fe5f08ff
46 changed files with 486 additions and 383 deletions

View file

@ -212,7 +212,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
match e.kind {
ast::ExprKind::Closure(_, _, ast::Async::Yes { closure_id, .. }, ..)
ast::ExprKind::Closure(box ast::Closure {
asyncness: ast::Async::Yes { closure_id, .. },
..
})
| ast::ExprKind::Async(_, closure_id, ..) => self.check_id(closure_id),
_ => {}
}

View file

@ -651,7 +651,7 @@ trait UnusedDelimLint {
ref call_or_other => {
let (args_to_check, ctx) = match *call_or_other {
Call(_, ref args) => (&args[..], UnusedDelimsCtx::FunctionArg),
MethodCall(_, _, ref args, _) => (&args[..], UnusedDelimsCtx::MethodArg),
MethodCall(ref call) => (&call.args[..], UnusedDelimsCtx::MethodArg),
// actual catch-all arm
_ => {
return;