summaryrefslogtreecommitdiffstats
path: root/tests/ui/check-cfg/invalid-cfg-value.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/check-cfg/invalid-cfg-value.rs')
-rw-r--r--tests/ui/check-cfg/invalid-cfg-value.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/check-cfg/invalid-cfg-value.rs b/tests/ui/check-cfg/invalid-cfg-value.rs
new file mode 100644
index 000000000..9e428d367
--- /dev/null
+++ b/tests/ui/check-cfg/invalid-cfg-value.rs
@@ -0,0 +1,18 @@
+// Check warning for invalid configuration value
+//
+// edition:2018
+// check-pass
+// compile-flags: --check-cfg=values(feature,"serde","full") --cfg=feature="rand" -Z unstable-options
+
+#[cfg(feature = "sedre")]
+//~^ WARNING unexpected `cfg` condition value
+pub fn f() {}
+
+#[cfg(feature = "serde")]
+pub fn g() {}
+
+#[cfg(feature = "rand")]
+//~^ WARNING unexpected `cfg` condition value
+pub fn h() {}
+
+pub fn main() {}