diff options
Diffstat (limited to 'tests/ui/cfg_features.fixed')
| -rw-r--r-- | tests/ui/cfg_features.fixed | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/cfg_features.fixed b/tests/ui/cfg_features.fixed new file mode 100644 index 00000000000..3d52f2382ea --- /dev/null +++ b/tests/ui/cfg_features.fixed @@ -0,0 +1,17 @@ +#![warn(clippy::maybe_misused_cfg)] + +fn main() { + #[cfg(feature = "not-really-a-feature")] + //~^ ERROR: feature may misspelled as features + //~| NOTE: `-D clippy::maybe-misused-cfg` implied by `-D warnings` + let _ = 1 + 2; + + #[cfg(all(feature = "right", feature = "wrong"))] + //~^ ERROR: feature may misspelled as features + let _ = 1 + 2; + + #[cfg(all(feature = "wrong1", any(feature = "right", feature = "wrong2", feature, features)))] + //~^ ERROR: feature may misspelled as features + //~| ERROR: feature may misspelled as features + let _ = 1 + 2; +} |
