Skip to content

Commit 7fd3bd0

Browse files
flip1995ebroto
authored andcommitted
Register redundant_field_names and non_expressive_names as early passes
1 parent f28c6de commit 7fd3bd0

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

clippy_lints/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -346,13 +346,8 @@ mod reexport {
346346
/// level (i.e `#![cfg_attr(...)]`) will still be expanded even when using a pre-expansion pass.
347347
///
348348
/// Used in `./src/driver.rs`.
349-
pub fn register_pre_expansion_lints(store: &mut rustc_lint::LintStore, conf: &Conf) {
349+
pub fn register_pre_expansion_lints(store: &mut rustc_lint::LintStore) {
350350
store.register_pre_expansion_pass(|| box write::Write::default());
351-
store.register_pre_expansion_pass(|| box redundant_field_names::RedundantFieldNames);
352-
let single_char_binding_names_threshold = conf.single_char_binding_names_threshold;
353-
store.register_pre_expansion_pass(move || box non_expressive_names::NonExpressiveNames {
354-
single_char_binding_names_threshold,
355-
});
356351
store.register_pre_expansion_pass(|| box attrs::EarlyAttributes);
357352
store.register_pre_expansion_pass(|| box dbg_macro::DbgMacro);
358353
}
@@ -1066,6 +1061,11 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
10661061
store.register_late_pass(|| box match_on_vec_items::MatchOnVecItems);
10671062
store.register_early_pass(|| box manual_non_exhaustive::ManualNonExhaustive);
10681063
store.register_late_pass(|| box manual_async_fn::ManualAsyncFn);
1064+
store.register_early_pass(|| box redundant_field_names::RedundantFieldNames);
1065+
let single_char_binding_names_threshold = conf.single_char_binding_names_threshold;
1066+
store.register_early_pass(move || box non_expressive_names::NonExpressiveNames {
1067+
single_char_binding_names_threshold,
1068+
});
10691069

10701070
store.register_group(true, "clippy::restriction", Some("clippy_restriction"), vec![
10711071
LintId::of(&arithmetic::FLOAT_ARITHMETIC),

src/driver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ impl rustc_driver::Callbacks for ClippyCallbacks {
7979

8080
let conf = clippy_lints::read_conf(&[], &sess);
8181
clippy_lints::register_plugins(&mut lint_store, &sess, &conf);
82-
clippy_lints::register_pre_expansion_lints(&mut lint_store, &conf);
82+
clippy_lints::register_pre_expansion_lints(&mut lint_store);
8383
clippy_lints::register_renamed(&mut lint_store);
8484
}));
8585

0 commit comments

Comments
 (0)