Skip to content

Commit f756a8b

Browse files
committed
Tidy
1 parent 131377e commit f756a8b

File tree

5 files changed

+13
-14
lines changed

5 files changed

+13
-14
lines changed

compiler/rustc_lint/src/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,7 @@ impl_lint_pass!(DeprecatedAttr => []);
902902

903903
impl std::default::Default for DeprecatedAttr {
904904
fn default() -> Self {
905-
DeprecatedAttr { depr_attrs: deprecated_attributes() }
905+
DeprecatedAttr { depr_attrs: deprecated_attributes() }
906906
}
907907
}
908908

compiler/rustc_lint/src/late.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//! for all lint attributes.
1616
1717
use crate::levels::lints_that_can_emit;
18-
use crate::{passes::LateLintPassObject, LateContext, LateLintPass, LintStore, Level};
18+
use crate::{passes::LateLintPassObject, LateContext, LateLintPass, Level, LintStore};
1919
use rustc_ast as ast;
2020
use rustc_data_structures::stack::ensure_sufficient_stack;
2121
use rustc_data_structures::sync::join;
@@ -425,14 +425,11 @@ fn late_lint_crate<'tcx>(tcx: TyCtxt<'tcx>) {
425425
let builder = lints_that_can_emit(tcx);
426426

427427
let mut passes: Vec<std::boxed::Box<dyn LateLintPass<'tcx>>> = passes
428-
.into_iter()
429-
.filter(|pass|
430-
LintPass::get_lints(pass)
431-
.iter()
432-
.any(|&lint| {
433-
builder.lint_level(lint).0 > Level::Allow
428+
.into_iter()
429+
.filter(|pass| {
430+
LintPass::get_lints(pass).iter().any(|&lint| builder.lint_level(lint).0 > Level::Allow)
434431
})
435-
).collect();
432+
.collect();
436433

437434
let pass = RuntimeCombinedLateLintPass { passes: &mut passes[..] };
438435
late_lint_crate_inner(tcx, context, pass);

compiler/rustc_lint/src/levels.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,10 @@ fn lint_expectations(tcx: TyCtxt<'_>, (): ()) -> Vec<(LintExpectationId, LintExp
154154
/// (e.g. `#[allow]` attributes), and joins that list with the warn-by-default
155155
/// (and not allowed in the crate) and CLI lints. The final result is a builder
156156
/// that has information about just lints that can be emitted (leaving out
157-
/// globally-allowed lints)
158-
pub(crate) fn lints_that_can_emit(tcx: TyCtxt<'_>) -> LintLevelsBuilder<'_, QueryMapExpectationsWrapper<'_>> {
157+
/// globally-allowed lints)
158+
pub(crate) fn lints_that_can_emit(
159+
tcx: TyCtxt<'_>,
160+
) -> LintLevelsBuilder<'_, QueryMapExpectationsWrapper<'_>> {
159161
let store = unerased_lint_store(tcx);
160162

161163
let mut builder = LintLevelsBuilder {
@@ -179,7 +181,6 @@ pub(crate) fn lints_that_can_emit(tcx: TyCtxt<'_>) -> LintLevelsBuilder<'_, Quer
179181
tcx.hir().walk_toplevel_module(&mut builder);
180182

181183
builder
182-
183184
}
184185

185186
#[instrument(level = "trace", skip(tcx), ret)]

compiler/rustc_lint_defs/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,4 +822,4 @@ impl<P: LintPass + ?Sized> LintPass for Box<P> {
822822
fn get_lints(&self) -> LintVec {
823823
(**self).get_lints()
824824
}
825-
}
825+
}

src/librustdoc/lint.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ where
3131
allowed_lints.extend(lint_opts.iter().map(|(lint, _)| lint).cloned());
3232

3333
let lints = || {
34-
lint::builtin::HardwiredLints::default().get_lints()
34+
lint::builtin::HardwiredLints::default()
35+
.get_lints()
3536
.into_iter()
3637
.chain(rustc_lint::SoftLints::default().get_lints().into_iter())
3738
};

0 commit comments

Comments
 (0)