This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +5
-18
lines changed
Expand file tree Collapse file tree 3 files changed +5
-18
lines changed Original file line number Diff line number Diff line change @@ -433,12 +433,10 @@ fn late_lint_crate<'tcx>(tcx: TyCtxt<'tcx>) {
433433 LintPass :: get_lints ( pass) . iter ( ) . any ( |& lint| hashmap. contains ( & LintId :: of ( lint) ) )
434434 } ) . collect ( ) ;
435435
436- // let mut passes: Vec<std::boxed::Box<dyn LateLintPass<'tcx>>> = passes
437- // .into_iter()
438- // .filter(|pass| {
439- // LintPass::get_lints(pass).iter().any(|&lint| )
440- // })
441- // .collect();
436+ // filtered_passes may be empty in case of `#[allow(all)]`
437+ if filtered_passes. is_empty ( ) {
438+ return ;
439+ }
442440
443441 let pass = RuntimeCombinedLateLintPass { passes : & mut filtered_passes[ ..] } ;
444442 late_lint_crate_inner ( tcx, context, pass) ;
Original file line number Diff line number Diff line change @@ -162,19 +162,11 @@ pub fn lints_that_can_emit(
162162) -> Vec < LintId > {
163163 let store = unerased_lint_store ( & tcx. sess ) ;
164164
165- // let mut builder = LintLevelsBuilder {
166- // sess: tcx.sess,
167- // features: tcx.features(),
168- // provider:
169- // warn_about_weird_lints: false,
170- // store,
171- // registered_tools: &tcx.registered_tools(()),
172- // };
173165 let specs = tcx. shallow_lint_levels_on ( hir:: CRATE_HIR_ID . owner ) ;
174166 let lints = store. get_lints ( ) ;
175167
176168 let mut hashmap: Vec < LintId > = Vec :: new ( ) ;
177- hashmap. reserve ( ( lints. len ( ) >> 1 ) * usize:: from ( tcx. sess . opts . lint_cap . is_some ( ) ) ) ; // Avoid allocations, it's better to
169+ hashmap. reserve ( ( lints. len ( ) >> 1 ) * usize:: from ( tcx. sess . opts . lint_cap . is_some ( ) ) ) ; // Avoid allocations
178170
179171 for & lint in lints {
180172 let lint_id = LintId :: of ( lint) ;
Original file line number Diff line number Diff line change @@ -137,9 +137,6 @@ pub fn provide(providers: &mut Providers) {
137137}
138138
139139fn lint_mod ( tcx : TyCtxt < ' _ > , module_def_id : LocalModDefId ) {
140- if let Some ( lint_cap) = tcx. sess . opts . lint_cap && lint_cap == Level :: Allow {
141- return ;
142- }
143140 late_lint_mod ( tcx, module_def_id, BuiltinCombinedModuleLateLintPass :: new ( ) ) ;
144141}
145142
You can’t perform that action at this time.
0 commit comments