summaryrefslogtreecommitdiffstats
path: root/src/test/ui/feature-gates/soft-syntax-gates-with-errors.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/feature-gates/soft-syntax-gates-with-errors.rs30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/test/ui/feature-gates/soft-syntax-gates-with-errors.rs b/src/test/ui/feature-gates/soft-syntax-gates-with-errors.rs
new file mode 100644
index 000000000..49f1cba71
--- /dev/null
+++ b/src/test/ui/feature-gates/soft-syntax-gates-with-errors.rs
@@ -0,0 +1,30 @@
+// check-fail
+// This file is used to test the behavior of the early-pass syntax warnings.
+// If macro syntax is stabilized, replace with a different unstable syntax.
+
+macro a() {}
+//~^ ERROR: `macro` is experimental
+
+#[cfg(FALSE)]
+macro b() {}
+
+macro_rules! identity {
+ ($($x:tt)*) => ($($x)*);
+}
+
+identity! {
+ macro c() {}
+ //~^ ERROR: `macro` is experimental
+}
+
+#[cfg(FALSE)]
+identity! {
+ macro d() {} // No error
+}
+
+identity! {
+ #[cfg(FALSE)]
+ macro e() {}
+}
+
+fn main() {}