about summary refs log tree commit diff
path: root/tests/ui/check-cfg/wrong-version-syntax.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/check-cfg/wrong-version-syntax.rs')
-rw-r--r--tests/ui/check-cfg/wrong-version-syntax.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/check-cfg/wrong-version-syntax.rs b/tests/ui/check-cfg/wrong-version-syntax.rs
new file mode 100644
index 00000000000..221ecf4cae8
--- /dev/null
+++ b/tests/ui/check-cfg/wrong-version-syntax.rs
@@ -0,0 +1,14 @@
+// Check warning for wrong `cfg(version("1.27"))` syntax
+//
+//@ check-pass
+//@ no-auto-check-cfg
+//@ compile-flags: --check-cfg=cfg()
+//@ run-rustfix
+
+#![feature(cfg_version)]
+
+#[cfg(not(version = "1.48.0"))]
+//~^ WARNING unexpected `cfg` condition name: `version`
+pub fn g() {}
+
+pub fn main() {}