diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2021-07-14 20:07:56 -0500 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2021-07-17 23:03:57 -0500 |
| commit | 2bd15a25ef24949abbcfe066c04cd2a266410c47 (patch) | |
| tree | be4393fcf20c54be6b128a7abc11330e242caf5b | |
| parent | ddd544856ecd181ee02490d12f723be549d3ecb3 (diff) | |
| download | rust-2bd15a25ef24949abbcfe066c04cd2a266410c47.tar.gz rust-2bd15a25ef24949abbcfe066c04cd2a266410c47.zip | |
Add missing `visit_expr_field`
| -rw-r--r-- | compiler/rustc_lint/src/early.rs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/compiler/rustc_lint/src/early.rs b/compiler/rustc_lint/src/early.rs index eb2e495f73d..63e2f66f810 100644 --- a/compiler/rustc_lint/src/early.rs +++ b/compiler/rustc_lint/src/early.rs @@ -120,6 +120,12 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T> }) } + fn visit_expr_field(&mut self, f: &'a ast::ExprField) { + self.with_lint_attrs(f.id, &f.attrs, |cx| { + ast_visit::walk_expr_field(cx, f); + }) + } + fn visit_stmt(&mut self, s: &'a ast::Stmt) { // Add the statement's lint attributes to our // current state when checking the statement itself. @@ -389,9 +395,15 @@ pub fn check_ast_crate<T: EarlyLintPass>( // All of the buffered lints should have been emitted at this point. // If not, that means that we somehow buffered a lint for a node id // that was not lint-checked (perhaps it doesn't exist?). This is a bug. - for (_id, lints) in buffered.map { + for (id, lints) in buffered.map { for early_lint in lints { - sess.delay_span_bug(early_lint.span, "failed to process buffered lint here"); + sess.delay_span_bug( + early_lint.span, + &format!( + "failed to process buffered lint here (dummy = {})", + id == ast::DUMMY_NODE_ID + ), + ); } } } |
