Skip to content

Commit

Permalink
Remove special casing of rustdoc in rustc_lint
Browse files Browse the repository at this point in the history
This is no longer necessary now that rustdoc doesn't run
everybody_loops.
  • Loading branch information
jyn514 committed Jan 22, 2021
1 parent 65767e5 commit 0679a4c
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions compiler/rustc_lint/src/early.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,17 +379,9 @@ 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.
//
// Rustdoc runs everybody-loops before the early lints and removes
// function bodies, so it's totally possible for linted
// node ids to not exist (e.g., macros defined within functions for the
// unused_macro lint) anymore. So we only run this check
// when we're not in rustdoc mode. (see issue #47639)
if !sess.opts.actually_rustdoc {
for (_id, lints) in buffered.map {
for early_lint in lints {
sess.delay_span_bug(early_lint.span, "failed to process buffered lint here");
}
for (_id, lints) in buffered.map {
for early_lint in lints {
sess.delay_span_bug(early_lint.span, "failed to process buffered lint here");
}
}
}

0 comments on commit 0679a4c

Please sign in to comment.