Wrap EarlyContext::visit_local/visit_expr in with_lint_attrs calls
LateContext already does this, looks like this was just forgotten in #29850
This commit is contained in:
parent
fec739bee2
commit
1fcc124de9
1 changed files with 9 additions and 5 deletions
|
|
@ -636,7 +636,7 @@ impl<'a> LintContext for EarlyContext<'a> {
|
|||
}
|
||||
|
||||
fn enter_attrs(&mut self, attrs: &[ast::Attribute]) {
|
||||
debug!("early context: exit_attrs({:?})", attrs);
|
||||
debug!("early context: enter_attrs({:?})", attrs);
|
||||
run_lints!(self, enter_lint_attrs, early_passes, attrs);
|
||||
}
|
||||
|
||||
|
|
@ -834,8 +834,10 @@ impl<'a, 'v> ast_visit::Visitor<'v> for EarlyContext<'a> {
|
|||
}
|
||||
|
||||
fn visit_expr(&mut self, e: &ast::Expr) {
|
||||
run_lints!(self, check_expr, early_passes, e);
|
||||
ast_visit::walk_expr(self, e);
|
||||
self.with_lint_attrs(e.attrs.as_attr_slice(), |cx| {
|
||||
run_lints!(cx, check_expr, early_passes, e);
|
||||
ast_visit::walk_expr(cx, e);
|
||||
})
|
||||
}
|
||||
|
||||
fn visit_stmt(&mut self, s: &ast::Stmt) {
|
||||
|
|
@ -890,8 +892,10 @@ impl<'a, 'v> ast_visit::Visitor<'v> for EarlyContext<'a> {
|
|||
}
|
||||
|
||||
fn visit_local(&mut self, l: &ast::Local) {
|
||||
run_lints!(self, check_local, early_passes, l);
|
||||
ast_visit::walk_local(self, l);
|
||||
self.with_lint_attrs(l.attrs.as_attr_slice(), |cx| {
|
||||
run_lints!(cx, check_local, early_passes, l);
|
||||
ast_visit::walk_local(cx, l);
|
||||
})
|
||||
}
|
||||
|
||||
fn visit_block(&mut self, b: &ast::Block) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue