]> git.lizzy.rs Git - rust.git/blob - tests/ui/macros/same-sequence-span.rs
Rollup merge of #106321 - compiler-errors:delayed-bug-backtrace, r=Nilstrieb
[rust.git] / tests / ui / macros / same-sequence-span.rs
1 // aux-build:proc_macro_sequence.rs
2
3 // Regression test for issue #62831: Check that multiple sequences with the same span in the
4 // left-hand side of a macro definition behave as if they had unique spans, and in particular that
5 // they don't crash the compiler.
6
7 #![allow(unused_macros)]
8
9 extern crate proc_macro_sequence;
10
11 // When ignoring spans, this macro has the same macro definition as `generated_foo` in
12 // `proc_macro_sequence.rs`.
13 macro_rules! manual_foo {
14     (1 $x:expr $($y:tt,)*   //~ERROR `$x:expr` may be followed by `$y:tt`
15                $(= $z:tt)*  //~ERROR `$x:expr` may be followed by `=`
16     ) => {};
17 }
18
19 proc_macro_sequence::make_foo!(); //~ERROR `$x:expr` may be followed by `$y:tt`
20                                   //~^ERROR `$x:expr` may be followed by `=`
21
22 fn main() {}