|
7 | 7 | use rustc_ast::ptr::P; |
8 | 8 | use rustc_ast::visit::{self as ast_visit, Visitor, walk_list}; |
9 | 9 | use rustc_ast::{self as ast, HasAttrs}; |
10 | | -use rustc_data_structures::fx::FxHashSet; |
11 | 10 | use rustc_data_structures::stack::ensure_sufficient_stack; |
12 | 11 | use rustc_feature::Features; |
13 | | -use rustc_hir::{HirId, ItemLocalId, OwnerId}; |
14 | | -use rustc_middle::hir; |
15 | | -use rustc_middle::lint::LintLevelSource; |
16 | 12 | use rustc_middle::ty::{RegisteredTools, TyCtxt}; |
17 | 13 | use rustc_session::lint::{BufferedEarlyLint, LintBuffer, LintPass}; |
18 | 14 | use rustc_session::{Session, lint}; |
19 | | -use rustc_span::def_id::CRATE_DEF_ID; |
20 | 15 | use rustc_span::{Ident, Span}; |
21 | 16 | use tracing::debug; |
22 | 17 |
|
23 | | -use crate::builtin::UnsafeCode; |
| 18 | +use crate::BuiltinCombinedEarlyLintPassMustRun; |
24 | 19 | use crate::context::{EarlyContext, LintContext, LintStore}; |
25 | 20 | use crate::passes::{EarlyLintPass, EarlyLintPassObject}; |
26 | | -use crate::{Level, LintId}; |
27 | 21 |
|
28 | 22 | pub(super) mod diagnostics; |
29 | 23 |
|
@@ -345,25 +339,14 @@ pub fn check_ast_node<'a>( |
345 | 339 | if passes.is_empty() { |
346 | 340 | if let Some(tcx) = tcx { |
347 | 341 | if sess.opts.lint_cap.is_some_and(|cap| cap == lint::Allow) { |
348 | | - let lints_that_must_run = builtin_lints |
349 | | - .get_lints() |
350 | | - .into_iter() |
351 | | - .filter(|lint| { |
352 | | - let has_future_breakage = lint |
353 | | - .future_incompatible |
354 | | - .is_some_and(|fut| fut.reason.has_future_breakage()); |
355 | | - has_future_breakage || lint.eval_always |
356 | | - }) |
357 | | - .collect::<Vec<_>>(); |
358 | | - eprintln!( |
359 | | - "LINT: must_run: {}, total: {}", |
360 | | - lints_that_must_run.len(), |
361 | | - builtin_lints.get_lints().len() |
| 342 | + check_ast_node_inner( |
| 343 | + sess, |
| 344 | + Some(tcx), |
| 345 | + check_node, |
| 346 | + context, |
| 347 | + BuiltinCombinedEarlyLintPassMustRun::new(), |
362 | 348 | ); |
363 | | - if !lints_that_must_run.is_empty() { |
364 | | - check_ast_node_inner(sess, Some(tcx), check_node, context, UnsafeCode); |
365 | | - return; |
366 | | - } |
| 349 | + return; |
367 | 350 | } |
368 | 351 | } |
369 | 352 | check_ast_node_inner(sess, tcx, check_node, context, builtin_lints); |
|
0 commit comments