]> git.lizzy.rs Git - rust.git/commitdiff
Register redundant_field_names and non_expressive_names as early passes
authorflip1995 <hello@philkrones.com>
Thu, 23 Apr 2020 22:14:03 +0000 (00:14 +0200)
committerflip1995 <hello@philkrones.com>
Tue, 16 Jun 2020 19:02:00 +0000 (21:02 +0200)
clippy_lints/src/lib.rs
src/driver.rs

index b8415fa3af12506f8d2cef72caff81a32d80856f..9057de99029bde5c1bc86558c2d2ede6911a7edb 100644 (file)
@@ -341,13 +341,8 @@ mod reexport {
 /// level (i.e `#![cfg_attr(...)]`) will still be expanded even when using a pre-expansion pass.
 ///
 /// Used in `./src/driver.rs`.
-pub fn register_pre_expansion_lints(store: &mut rustc_lint::LintStore, conf: &Conf) {
+pub fn register_pre_expansion_lints(store: &mut rustc_lint::LintStore) {
     store.register_pre_expansion_pass(|| box write::Write::default());
-    store.register_pre_expansion_pass(|| box redundant_field_names::RedundantFieldNames);
-    let single_char_binding_names_threshold = conf.single_char_binding_names_threshold;
-    store.register_pre_expansion_pass(move || box non_expressive_names::NonExpressiveNames {
-        single_char_binding_names_threshold,
-    });
     store.register_pre_expansion_pass(|| box attrs::DeprecatedCfgAttribute);
     store.register_pre_expansion_pass(|| box dbg_macro::DbgMacro);
 }
@@ -1051,6 +1046,11 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
     store.register_late_pass(|| box unnamed_address::UnnamedAddress);
     store.register_late_pass(|| box dereference::Dereferencing);
     store.register_late_pass(|| box future_not_send::FutureNotSend);
+    store.register_early_pass(|| box redundant_field_names::RedundantFieldNames);
+    let single_char_binding_names_threshold = conf.single_char_binding_names_threshold;
+    store.register_early_pass(move || box non_expressive_names::NonExpressiveNames {
+        single_char_binding_names_threshold,
+    });
 
     store.register_group(true, "clippy::restriction", Some("clippy_restriction"), vec![
         LintId::of(&arithmetic::FLOAT_ARITHMETIC),
index 2c699998ea90e237cdb708de9eb62507f3d0c60c..928497ba5e43b377af02dcc092c6531ea220d1e4 100644 (file)
@@ -79,7 +79,7 @@ fn config(&mut self, config: &mut interface::Config) {
 
             let conf = clippy_lints::read_conf(&[], &sess);
             clippy_lints::register_plugins(&mut lint_store, &sess, &conf);
-            clippy_lints::register_pre_expansion_lints(&mut lint_store, &conf);
+            clippy_lints::register_pre_expansion_lints(&mut lint_store);
             clippy_lints::register_renamed(&mut lint_store);
         }));