File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -407,20 +407,28 @@ declare_clippy_lint! {
407
407
/// Checks for `#[cfg(features = "...")]` and suggests to replace it with
408
408
/// `#[cfg(feature = "...")]`.
409
409
///
410
+ /// It also checks if `cfg(test)` was misspelled.
411
+ ///
410
412
/// ### Why is this bad?
411
413
/// Misspelling `feature` as `features` can be sometimes hard to spot. It
412
414
/// may cause conditional compilation not work quietly.
413
415
///
416
+ /// Same goes for misspelling `test`.
417
+ ///
414
418
/// ### Example
415
419
/// ```no_run
416
420
/// #[cfg(features = "some-feature")]
417
421
/// fn conditional() { }
422
+ /// #[cfg(tests)]
423
+ /// mod tests() { }
418
424
/// ```
419
425
///
420
426
/// Use instead:
421
427
/// ```no_run
422
428
/// #[cfg(feature = "some-feature")]
423
429
/// fn conditional() { }
430
+ /// #[cfg(test)]
431
+ /// mod tests() { }
424
432
/// ```
425
433
#[ clippy:: version = "1.69.0" ]
426
434
pub MAYBE_MISUSED_CFG ,
You can’t perform that action at this time.
0 commit comments