Skip to content

Commit 1966d0d

Browse files
Update documentation for MAYBE_MISUSED_CFG lint
1 parent 3a8aff1 commit 1966d0d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

clippy_lints/src/attrs.rs

+8
Original file line numberDiff line numberDiff line change
@@ -407,20 +407,28 @@ declare_clippy_lint! {
407407
/// Checks for `#[cfg(features = "...")]` and suggests to replace it with
408408
/// `#[cfg(feature = "...")]`.
409409
///
410+
/// It also checks if `cfg(test)` was misspelled.
411+
///
410412
/// ### Why is this bad?
411413
/// Misspelling `feature` as `features` can be sometimes hard to spot. It
412414
/// may cause conditional compilation not work quietly.
413415
///
416+
/// Same goes for misspelling `test`.
417+
///
414418
/// ### Example
415419
/// ```no_run
416420
/// #[cfg(features = "some-feature")]
417421
/// fn conditional() { }
422+
/// #[cfg(tests)]
423+
/// mod tests() { }
418424
/// ```
419425
///
420426
/// Use instead:
421427
/// ```no_run
422428
/// #[cfg(feature = "some-feature")]
423429
/// fn conditional() { }
430+
/// #[cfg(test)]
431+
/// mod tests() { }
424432
/// ```
425433
#[clippy::version = "1.69.0"]
426434
pub MAYBE_MISUSED_CFG,

0 commit comments

Comments
 (0)