about summary refs log tree commit diff
path: root/clippy_lints/src/large_stack_frames.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-07-17 18:13:07 +0000
committerbors <bors@rust-lang.org>2024-07-17 18:13:07 +0000
commitf74037e47ae8467bade27f9a5d520bfbbd7899a5 (patch)
tree116eadb846c5d9274bf08e48bfbcda6f47a0fbd9 /clippy_lints/src/large_stack_frames.rs
parent0ee9f44568b60aaef5d04684cb08f112edd89542 (diff)
parente34c6dbae5768b5dce90c02465f3492376327c65 (diff)
downloadrust-f74037e47ae8467bade27f9a5d520bfbbd7899a5.tar.gz
rust-f74037e47ae8467bade27f9a5d520bfbbd7899a5.zip
Auto merge of #13088 - Jarcho:conf_refactor2, r=flip1995
Create lint passes using `Conf`

This slightly reduces the amount of code changes needed to add a config to a lint and makes things makes things more consistent between passes. A dependence on the config being a static reference is also added. This would only ever be a problem if multiple crates end up compiled in a single process.

Other changes include:
* Removing useless `#[derive(..)]`s
* Removing `#[must_use]` on lint pass constructors.
* Unified the parsing of the `DisallowedPath` struct in lint passes.
* Update `disallowed_types` and `await_holding_invalid` messages to be consistent with other disallowed lints.
* Remove the `(from clippy.toml)` message. I plan on having all the configured lints point to point to a span in `clippy.toml` which will be more useful.

changelog: none
Diffstat (limited to 'clippy_lints/src/large_stack_frames.rs')
-rw-r--r--clippy_lints/src/large_stack_frames.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/clippy_lints/src/large_stack_frames.rs b/clippy_lints/src/large_stack_frames.rs
index 49408d7e243..4abf7edc9b4 100644
--- a/clippy_lints/src/large_stack_frames.rs
+++ b/clippy_lints/src/large_stack_frames.rs
@@ -1,5 +1,6 @@
 use std::{fmt, ops};
 
+use clippy_config::Conf;
 use clippy_utils::diagnostics::span_lint_and_then;
 use clippy_utils::fn_has_unsatisfiable_preds;
 use clippy_utils::source::snippet_opt;
@@ -85,10 +86,9 @@ pub struct LargeStackFrames {
 }
 
 impl LargeStackFrames {
-    #[must_use]
-    pub fn new(size: u64) -> Self {
+    pub fn new(conf: &'static Conf) -> Self {
         Self {
-            maximum_allowed_size: size,
+            maximum_allowed_size: conf.stack_size_threshold,
         }
     }
 }