diff options
Diffstat (limited to 'tests/ui/feature-gates/soft-syntax-gates-with-errors.rs')
-rw-r--r-- | tests/ui/feature-gates/soft-syntax-gates-with-errors.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/ui/feature-gates/soft-syntax-gates-with-errors.rs b/tests/ui/feature-gates/soft-syntax-gates-with-errors.rs new file mode 100644 index 000000000..49f1cba71 --- /dev/null +++ b/tests/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() {} |