Skip to content

Commit 2bd15a2

Browse files
committed
Add missing visit_expr_field
1 parent ddd5448 commit 2bd15a2

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

compiler/rustc_lint/src/early.rs

+14-2
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T>
120120
})
121121
}
122122

123+
fn visit_expr_field(&mut self, f: &'a ast::ExprField) {
124+
self.with_lint_attrs(f.id, &f.attrs, |cx| {
125+
ast_visit::walk_expr_field(cx, f);
126+
})
127+
}
128+
123129
fn visit_stmt(&mut self, s: &'a ast::Stmt) {
124130
// Add the statement's lint attributes to our
125131
// current state when checking the statement itself.
@@ -389,9 +395,15 @@ pub fn check_ast_crate<T: EarlyLintPass>(
389395
// All of the buffered lints should have been emitted at this point.
390396
// If not, that means that we somehow buffered a lint for a node id
391397
// that was not lint-checked (perhaps it doesn't exist?). This is a bug.
392-
for (_id, lints) in buffered.map {
398+
for (id, lints) in buffered.map {
393399
for early_lint in lints {
394-
sess.delay_span_bug(early_lint.span, "failed to process buffered lint here");
400+
sess.delay_span_bug(
401+
early_lint.span,
402+
&format!(
403+
"failed to process buffered lint here (dummy = {})",
404+
id == ast::DUMMY_NODE_ID
405+
),
406+
);
395407
}
396408
}
397409
}

0 commit comments

Comments
 (0)