summaryrefslogtreecommitdiffstats
path: root/src/test/ui/check-cfg/allow-upper-level.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/check-cfg/allow-upper-level.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/check-cfg/allow-upper-level.rs b/src/test/ui/check-cfg/allow-upper-level.rs
new file mode 100644
index 000000000..04340694d
--- /dev/null
+++ b/src/test/ui/check-cfg/allow-upper-level.rs
@@ -0,0 +1,12 @@
+// This test check that #[allow(unexpected_cfgs)] work if put on an upper level
+//
+// check-pass
+// compile-flags:--check-cfg=names() -Z unstable-options
+
+#[allow(unexpected_cfgs)]
+mod aa {
+ #[cfg(FALSE)]
+ fn bar() {}
+}
+
+fn main() {}