diff --git a/tests/ui/README.md b/tests/ui/README.md index 6cec5a27d21c..13b213f9cf79 100644 --- a/tests/ui/README.md +++ b/tests/ui/README.md @@ -891,12 +891,6 @@ Exercise *Link-Time Optimization* (LTO), involving the flags `-C lto` or `-Z thi Tests on changes to inference variable lattice LUB/GLB, see . -## `tests/ui/macro_backtrace/`: `-Zmacro-backtrace` - -Contains a single test, checking the unstable command-line flag to enable detailed macro backtraces. - -**FIXME**: This could be merged with `ui/macros`, which already contains other macro backtrace tests. - ## `tests/ui/macros/` Broad category of tests on macros. diff --git a/tests/ui/macro_backtrace/auxiliary/ping.rs b/tests/ui/macros/auxiliary/ping.rs similarity index 71% rename from tests/ui/macro_backtrace/auxiliary/ping.rs rename to tests/ui/macros/auxiliary/ping.rs index 25b9efbc93ac..d009acb02adb 100644 --- a/tests/ui/macro_backtrace/auxiliary/ping.rs +++ b/tests/ui/macros/auxiliary/ping.rs @@ -1,30 +1,30 @@ -// Test that the macro backtrace facility works (supporting file) +// Test that the macro backtrace facility works (supporting macro-backtrace-complex.rs) // a non-local macro #[macro_export] macro_rules! ping { () => { pong!(); - } + }; } #[macro_export] macro_rules! deep { () => { foo!(); - } + }; } #[macro_export] macro_rules! foo { () => { bar!(); - } + }; } #[macro_export] macro_rules! bar { () => { ping!(); - } + }; } diff --git a/tests/ui/macro_backtrace/main.-Zmacro-backtrace.stderr b/tests/ui/macros/macro-backtrace-complex.-Zmacro-backtrace.stderr similarity index 94% rename from tests/ui/macro_backtrace/main.-Zmacro-backtrace.stderr rename to tests/ui/macros/macro-backtrace-complex.-Zmacro-backtrace.stderr index bf85a2d75db2..18df7f4a6784 100644 --- a/tests/ui/macro_backtrace/main.-Zmacro-backtrace.stderr +++ b/tests/ui/macros/macro-backtrace-complex.-Zmacro-backtrace.stderr @@ -1,5 +1,5 @@ error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error` - --> $DIR/main.rs:10:20 + --> $DIR/macro-backtrace-complex.rs:12:20 | LL | / macro_rules! pong { LL | | () => { syntax error }; @@ -11,7 +11,7 @@ LL | pong!(); | ------- in this macro invocation error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error` - --> $DIR/main.rs:10:20 + --> $DIR/macro-backtrace-complex.rs:12:20 | LL | / macro_rules! pong { LL | | () => { syntax error }; @@ -31,7 +31,7 @@ LL | pong!(); | ------- in this macro invocation (#2) error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error` - --> $DIR/main.rs:10:20 + --> $DIR/macro-backtrace-complex.rs:12:20 | LL | / macro_rules! pong { LL | | () => { syntax error }; diff --git a/tests/ui/macro_backtrace/main.default.stderr b/tests/ui/macros/macro-backtrace-complex.default.stderr similarity index 90% rename from tests/ui/macro_backtrace/main.default.stderr rename to tests/ui/macros/macro-backtrace-complex.default.stderr index 9ed4b3525e1d..6aae85c1501a 100644 --- a/tests/ui/macro_backtrace/main.default.stderr +++ b/tests/ui/macros/macro-backtrace-complex.default.stderr @@ -1,5 +1,5 @@ error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error` - --> $DIR/main.rs:10:20 + --> $DIR/macro-backtrace-complex.rs:12:20 | LL | () => { syntax error }; | ^^^^^ expected one of 8 possible tokens @@ -10,7 +10,7 @@ LL | pong!(); = note: this error originates in the macro `pong` (in Nightly builds, run with -Z macro-backtrace for more info) error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error` - --> $DIR/main.rs:10:20 + --> $DIR/macro-backtrace-complex.rs:12:20 | LL | () => { syntax error }; | ^^^^^ expected one of 8 possible tokens @@ -21,7 +21,7 @@ LL | ping!(); = note: this error originates in the macro `pong` which comes from the expansion of the macro `ping` (in Nightly builds, run with -Z macro-backtrace for more info) error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error` - --> $DIR/main.rs:10:20 + --> $DIR/macro-backtrace-complex.rs:12:20 | LL | () => { syntax error }; | ^^^^^ expected one of 8 possible tokens diff --git a/tests/ui/macro_backtrace/main.rs b/tests/ui/macros/macro-backtrace-complex.rs similarity index 68% rename from tests/ui/macro_backtrace/main.rs rename to tests/ui/macros/macro-backtrace-complex.rs index e39cecb5938b..3ab586f54653 100644 --- a/tests/ui/macro_backtrace/main.rs +++ b/tests/ui/macros/macro-backtrace-complex.rs @@ -1,9 +1,11 @@ -// Test that the macro backtrace facility works +// Test the unstable command-line flag (-Z macro-backtrace) to enable detailed macro backtraces +// across nested local and external macros. //@ aux-build:ping.rs //@ revisions: default -Zmacro-backtrace //@[-Zmacro-backtrace] compile-flags: -Z macro-backtrace -#[macro_use] extern crate ping; +#[macro_use] +extern crate ping; // a local macro macro_rules! pong {