diff options
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/macro_backtrace/auxiliary/ping.rs | 21 | ||||
| -rw-r--r-- | src/test/ui/macro_backtrace/main.rs | 5 | ||||
| -rw-r--r-- | src/test/ui/macro_backtrace/main.stderr | 86 |
3 files changed, 103 insertions, 9 deletions
diff --git a/src/test/ui/macro_backtrace/auxiliary/ping.rs b/src/test/ui/macro_backtrace/auxiliary/ping.rs index eeed0d78158..e4131dde8f7 100644 --- a/src/test/ui/macro_backtrace/auxiliary/ping.rs +++ b/src/test/ui/macro_backtrace/auxiliary/ping.rs @@ -18,3 +18,24 @@ macro_rules! ping { } } +#[macro_export] +macro_rules! deep { + () => { + foo!(); + } +} + +#[macro_export] +macro_rules! foo { + () => { + bar!(); + } +} + +#[macro_export] +macro_rules! bar { + () => { + ping!(); + } +} + diff --git a/src/test/ui/macro_backtrace/main.rs b/src/test/ui/macro_backtrace/main.rs index ec9218e3ec0..77faac17d1a 100644 --- a/src/test/ui/macro_backtrace/main.rs +++ b/src/test/ui/macro_backtrace/main.rs @@ -16,11 +16,14 @@ // a local macro macro_rules! pong { - () => { syntax error }; //~ ERROR expected one of + () => { syntax error }; //~^ ERROR expected one of + //~| ERROR expected one of + //~| ERROR expected one of } fn main() { pong!(); ping!(); + deep!(); } diff --git a/src/test/ui/macro_backtrace/main.stderr b/src/test/ui/macro_backtrace/main.stderr index 4b10e5e19a3..e543a9f5bc0 100644 --- a/src/test/ui/macro_backtrace/main.stderr +++ b/src/test/ui/macro_backtrace/main.stderr @@ -1,17 +1,87 @@ error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error` --> $DIR/main.rs:19:20 | -19 | () => { syntax error }; //~ ERROR expected one of - | ^^^^^ expected one of 8 possible tokens here -$DIR/main.rs:24:5: 24:13 note: in this expansion of pong! (defined in $DIR/main.rs) +18 | / macro_rules! pong { +19 | | () => { syntax error }; + | | ^^^^^ expected one of 8 possible tokens here +20 | | //~^ ERROR expected one of +21 | | //~| ERROR expected one of +22 | | //~| ERROR expected one of +23 | | } + | |_- in this expansion of `pong!` +... +26 | pong!(); + | -------- in this macro invocation error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error` --> $DIR/main.rs:19:20 | -19 | () => { syntax error }; //~ ERROR expected one of - | ^^^^^ expected one of 8 possible tokens here -$DIR/main.rs:25:5: 25:13 note: in this expansion of ping! (defined in <ping macros>) -<ping macros>:1:11: 1:24 note: in this expansion of pong! (defined in $DIR/main.rs) +18 | / macro_rules! pong { +19 | | () => { syntax error }; + | | ^^^^^ expected one of 8 possible tokens here +20 | | //~^ ERROR expected one of +21 | | //~| ERROR expected one of +22 | | //~| ERROR expected one of +23 | | } + | |_- in this expansion of `pong!` +... +27 | ping!(); + | -------- in this macro invocation + | + ::: <ping macros> + | +1 | ( ) => { pong ! ( ) ; } + | ------------------------- + | | | + | | in this macro invocation + | in this expansion of `ping!` + +error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error` + --> $DIR/main.rs:19:20 + | +18 | / macro_rules! pong { +19 | | () => { syntax error }; + | | ^^^^^ expected one of 8 possible tokens here +20 | | //~^ ERROR expected one of +21 | | //~| ERROR expected one of +22 | | //~| ERROR expected one of +23 | | } + | |_- in this expansion of `pong!` (#5) +... +28 | deep!(); + | -------- in this macro invocation (#1) + | + ::: <deep macros> + | +1 | ( ) => { foo ! ( ) ; } + | ------------------------ + | | | + | | in this macro invocation (#2) + | in this expansion of `deep!` (#1) + | + ::: <foo macros> + | +1 | ( ) => { bar ! ( ) ; } + | ------------------------ + | | | + | | in this macro invocation (#3) + | in this expansion of `foo!` (#2) + | + ::: <bar macros> + | +1 | ( ) => { ping ! ( ) ; } + | ------------------------- + | | | + | | in this macro invocation (#4) + | in this expansion of `bar!` (#3) + | + ::: <ping macros> + | +1 | ( ) => { pong ! ( ) ; } + | ------------------------- + | | | + | | in this macro invocation (#5) + | in this expansion of `ping!` (#4) -error: aborting due to 2 previous errors +error: aborting due to 3 previous errors |
