Skip to content

Commit

Permalink
Update documentation for MAYBE_MISUSED_CFG lint
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Nov 16, 2023
1 parent 3a8aff1 commit 1966d0d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions clippy_lints/src/attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,20 +407,28 @@ 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
/// may cause conditional compilation not work quietly.
///
/// Same goes for misspelling `test`.
///
/// ### 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,
Expand Down

0 comments on commit 1966d0d

Please sign in to comment.