about summary refs log tree commit diff
path: root/clippy_dev/src
diff options
context:
space:
mode:
authorPhilipp Krones <hello@philkrones.com>2024-07-25 18:29:17 +0200
committerPhilipp Krones <hello@philkrones.com>2024-07-25 18:29:17 +0200
commit4e6851e50bde42cef280076aa48035871bfe9520 (patch)
tree2ef7c556ab708bcf7ffd666fcfa76ccfa8378de8 /clippy_dev/src
parent6d674685ae4e9156dbb6ecd3aa38d87864ecab3e (diff)
downloadrust-4e6851e50bde42cef280076aa48035871bfe9520.tar.gz
rust-4e6851e50bde42cef280076aa48035871bfe9520.zip
Merge commit '37f4fbb92913586b73a35772efd00eccd1cbbe13' into clippy-subtree-update
Diffstat (limited to 'clippy_dev/src')
-rw-r--r--clippy_dev/src/new_lint.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/clippy_dev/src/new_lint.rs b/clippy_dev/src/new_lint.rs
index d762e30ef02..de91233d196 100644
--- a/clippy_dev/src/new_lint.rs
+++ b/clippy_dev/src/new_lint.rs
@@ -140,7 +140,7 @@ fn add_lint(lint: &LintData<'_>, enable_msrv: bool) -> io::Result<()> {
 
     let new_lint = if enable_msrv {
         format!(
-            "store.register_{lint_pass}_pass(move |{ctor_arg}| Box::new({module_name}::{camel_name}::new(msrv())));\n    ",
+            "store.register_{lint_pass}_pass(move |{ctor_arg}| Box::new({module_name}::{camel_name}::new(conf)));\n    ",
             lint_pass = lint.pass,
             ctor_arg = if lint.pass == "late" { "_" } else { "" },
             module_name = lint.name,
@@ -274,6 +274,7 @@ fn get_lint_file_contents(lint: &LintData<'_>, enable_msrv: bool) -> String {
         formatdoc!(
             r#"
             use clippy_config::msrvs::{{self, Msrv}};
+            use clippy_config::Conf;
             {pass_import}
             use rustc_lint::{{{context_import}, {pass_type}, LintContext}};
             use rustc_session::impl_lint_pass;
@@ -301,9 +302,8 @@ fn get_lint_file_contents(lint: &LintData<'_>, enable_msrv: bool) -> String {
             }}
 
             impl {name_camel} {{
-                #[must_use]
-                pub fn new(msrv: Msrv) -> Self {{
-                    Self {{ msrv }}
+                pub fn new(conf: &'static Conf) -> Self {{
+                    Self {{ msrv: conf.msrv.clone() }}
                 }}
             }}