Skip to content

Commit bbffe00

Browse files
committed
format
1 parent 0e844e5 commit bbffe00

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

compiler/rustc_lint/src/levels.rs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ use crate::{
1515
};
1616
use rustc_ast as ast;
1717
use rustc_ast_pretty::pprust;
18-
use rustc_data_structures::{fx::FxIndexMap, sync::{Lrc, par_for_each_in, Lock}};
18+
use rustc_data_structures::{
19+
fx::FxIndexMap,
20+
sync::{par_for_each_in, Lock, Lrc},
21+
};
1922
use rustc_errors::{Diag, DiagMessage, LintDiagnostic, MultiSpan};
2023
use rustc_feature::{Features, GateIssue};
2124
use rustc_hir as hir;
@@ -491,27 +494,26 @@ impl<'tcx> LintLevelMinimum<'tcx> {
491494
fn process_opts(&mut self) {
492495
for (lint, level) in &self.tcx.sess.opts.lint_opts {
493496
if *level == Level::Allow {
494-
self.lints_allowed.with_lock(|lints_allowed|{lints_allowed.push(Symbol::intern(&lint)) });
497+
self.lints_allowed
498+
.with_lock(|lints_allowed| lints_allowed.push(Symbol::intern(&lint)));
495499
} else {
496-
self.lints_to_emit.with_lock(|lints_to_emit| {lints_to_emit.push(Symbol::intern(&lint)) });
500+
self.lints_to_emit
501+
.with_lock(|lints_to_emit| lints_to_emit.push(Symbol::intern(&lint)));
497502
}
498503
}
499504
}
500505

501506
fn lint_level_minimums(&mut self, tcx: TyCtxt<'tcx>) {
502507
tcx.sess.psess.lints_that_can_emit.with_lock(|vec| {
503508
par_for_each_in(vec, |lint_symbol| {
504-
self.lints_to_emit.with_lock(|lints_to_emit| {lints_to_emit.push(*lint_symbol)});
505-
}
506-
);
507-
});
509+
self.lints_to_emit.with_lock(|lints_to_emit| lints_to_emit.push(*lint_symbol));
510+
});
511+
});
508512
tcx.sess.psess.lints_allowed.with_lock(|vec| {
509513
par_for_each_in(vec, |lint_symbol| {
510-
self.lints_allowed.with_lock(|lints_allowed| {lints_allowed.push(*lint_symbol)});
511-
}
512-
);
513-
});
514-
514+
self.lints_allowed.with_lock(|lints_allowed| lints_allowed.push(*lint_symbol));
515+
});
516+
});
515517
}
516518
}
517519

compiler/rustc_parse/src/parser/attr.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ impl<'a> Parser<'a> {
135135
Ok(attr::mk_attr_from_item(&self.psess.attr_id_generator, item, None, style, attr_sp))
136136
});
137137

138-
if let Ok(ref attr) = attribute_result && let Some(meta) = attr.meta() {
138+
if let Ok(ref attr) = attribute_result
139+
&& let Some(meta) = attr.meta()
140+
{
139141
if let Some(first) = meta.path.segments.first() {
140142
if [sym::warn, sym::deny, sym::forbid]
141143
.iter()
@@ -145,17 +147,13 @@ impl<'a> Parser<'a> {
145147
// If it's a tool lint (e.g. clippy::my_clippy_lint)
146148
if let ast::NestedMetaItem::MetaItem(ref meta_item) = meta_list {
147149
if meta_item.path.segments.len() == 1 {
148-
self.psess
149-
.lints_that_can_emit.with_lock(|lints_that_can_emit| {
150-
lints_that_can_emit
151-
.push(meta_list.ident().unwrap().name);
152-
})
150+
self.psess.lints_that_can_emit.with_lock(|lints_that_can_emit| {
151+
lints_that_can_emit.push(meta_list.ident().unwrap().name);
152+
})
153153
} else {
154-
self.psess
155-
.lints_that_can_emit.with_lock(|lints_that_can_emit| {
156-
lints_that_can_emit
157-
.push(meta_item.path.segments[1].ident.name);
158-
})
154+
self.psess.lints_that_can_emit.with_lock(|lints_that_can_emit| {
155+
lints_that_can_emit.push(meta_item.path.segments[1].ident.name);
156+
})
159157
}
160158
}
161159
}

compiler/rustc_session/src/parse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ pub struct ParseSess {
238238
/// The list of lints that cannot emit, maybe because they are allowed
239239
/// globally, or the default level is Allow and they are not activated
240240
/// manually
241-
pub lints_allowed: Lock<Vec<Symbol>>
241+
pub lints_allowed: Lock<Vec<Symbol>>,
242242
}
243243

244244
impl ParseSess {

0 commit comments

Comments
 (0)