From f08037c2f51bf65825a707a2dff1bcbe0c45278d Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 16 Nov 2023 13:40:48 +0100 Subject: [PATCH] Update documentation for `MAYBE_MISUSED_CFG` lint --- clippy_lints/src/attrs.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/clippy_lints/src/attrs.rs b/clippy_lints/src/attrs.rs index 2d8f8e18fda6..cf244324ae15 100644 --- a/clippy_lints/src/attrs.rs +++ b/clippy_lints/src/attrs.rs @@ -407,20 +407,26 @@ declare_clippy_lint! { /// Checks for `#[cfg(features = "...")]` and suggests to replace it with /// `#[cfg(feature = "...")]`. /// + /// It also checks if `cfg(test)` was misspelled. + /// /// ### Why is this bad? - /// Misspelling `feature` as `features` can be sometimes hard to spot. It + /// Misspelling `feature` as `features` or `test` as `tests` can be sometimes hard to spot. It /// may cause conditional compilation not work quietly. /// /// ### Example /// ```no_run /// #[cfg(features = "some-feature")] /// fn conditional() { } + /// #[cfg(tests)] + /// mod tests { } /// ``` /// /// Use instead: /// ```no_run /// #[cfg(feature = "some-feature")] /// fn conditional() { } + /// #[cfg(test)] + /// mod tests { } /// ``` #[clippy::version = "1.69.0"] pub MAYBE_MISUSED_CFG,