File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -407,20 +407,26 @@ 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
- /// Misspelling `feature` as `features` can be sometimes hard to spot. It
413
+ /// Misspelling `feature` as `features` or `test` as `tests` can be sometimes hard to spot. It
412
414
/// may cause conditional compilation not work quietly.
413
415
///
414
416
/// ### Example
415
417
/// ```no_run
416
418
/// #[cfg(features = "some-feature")]
417
419
/// fn conditional() { }
420
+ /// #[cfg(tests)]
421
+ /// mod tests { }
418
422
/// ```
419
423
///
420
424
/// Use instead:
421
425
/// ```no_run
422
426
/// #[cfg(feature = "some-feature")]
423
427
/// fn conditional() { }
428
+ /// #[cfg(test)]
429
+ /// mod tests { }
424
430
/// ```
425
431
#[ clippy:: version = "1.69.0" ]
426
432
pub MAYBE_MISUSED_CFG ,
You can’t perform that action at this time.
0 commit comments