summaryrefslogtreecommitdiffstats
path: root/tests/ui/check-cfg/unexpected-cfg-value.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/ui/check-cfg/unexpected-cfg-value.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/check-cfg/unexpected-cfg-value.rs b/tests/ui/check-cfg/unexpected-cfg-value.rs
new file mode 100644
index 000000000..a84458071
--- /dev/null
+++ b/tests/ui/check-cfg/unexpected-cfg-value.rs
@@ -0,0 +1,22 @@
+// Check warning for invalid configuration value in the code and
+// in the cli
+//
+// check-pass
+// revisions: values cfg
+// compile-flags: --cfg=feature="rand" -Z unstable-options
+// compile-flags: --check-cfg=cfg(values,cfg)
+// [values]compile-flags: --check-cfg=values(feature,"serde","full")
+// [cfg]compile-flags: --check-cfg=cfg(feature,values("serde","full"))
+
+#[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() {}