about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTrevor Gross <tmgross@umich.edu>2025-06-20 16:50:20 -0400
committerTrevor Gross <tmgross@umich.edu>2025-06-23 06:25:55 -0500
commitcf5eb279101511fa9ee38988adab7cac9a57f0da (patch)
tree573d2e129aadaf2fc5612d189195fef311ccf3f5
parent22be76b7e259f27bf3e55eb931f354cd8b69d55f (diff)
downloadrust-cf5eb279101511fa9ee38988adab7cac9a57f0da.tar.gz
rust-cf5eb279101511fa9ee38988adab7cac9a57f0da.zip
mbe: Restructure `macro_metavar_expr` tests
These tests have expanded beyond the RFC, so rename the directory
`rfc-3086-metavar-expr` to `metavar-expressions`. `concat` (which wasn't
part of the RFC) now fits in this group, so merge its tests into the
`metavar-expressions` directory.

Additionally rename some related `issue-*` tests.
-rw-r--r--src/tools/tidy/src/issues.txt1
-rw-r--r--tests/ui/macros/metavar-expressions/concat-allowed-operations.rs (renamed from tests/ui/macros/macro-metavar-expr-concat/allowed-operations.rs)0
-rw-r--r--tests/ui/macros/metavar-expressions/concat-hygiene.rs (renamed from tests/ui/macros/macro-metavar-expr-concat/hygiene.rs)0
-rw-r--r--tests/ui/macros/metavar-expressions/concat-hygiene.stderr (renamed from tests/ui/macros/macro-metavar-expr-concat/hygiene.stderr)2
-rw-r--r--tests/ui/macros/metavar-expressions/concat-raw-identifiers.rs (renamed from tests/ui/macros/macro-metavar-expr-concat/raw-identifiers.rs)0
-rw-r--r--tests/ui/macros/metavar-expressions/concat-raw-identifiers.stderr (renamed from tests/ui/macros/macro-metavar-expr-concat/raw-identifiers.stderr)28
-rw-r--r--tests/ui/macros/metavar-expressions/concat-repetitions.rs (renamed from tests/ui/macros/macro-metavar-expr-concat/repetitions.rs)0
-rw-r--r--tests/ui/macros/metavar-expressions/concat-repetitions.stderr (renamed from tests/ui/macros/macro-metavar-expr-concat/repetitions.stderr)6
-rw-r--r--tests/ui/macros/metavar-expressions/concat-syntax-errors.rs (renamed from tests/ui/macros/macro-metavar-expr-concat/syntax-errors.rs)0
-rw-r--r--tests/ui/macros/metavar-expressions/concat-syntax-errors.stderr (renamed from tests/ui/macros/macro-metavar-expr-concat/syntax-errors.stderr)66
-rw-r--r--tests/ui/macros/metavar-expressions/concat-unicode-expansion.rs (renamed from tests/ui/macros/macro-metavar-expr-concat/unicode-expansion.rs)0
-rw-r--r--tests/ui/macros/metavar-expressions/count-and-length-are-distinct.rs (renamed from tests/ui/macros/rfc-3086-metavar-expr/count-and-length-are-distinct.rs)0
-rw-r--r--tests/ui/macros/metavar-expressions/count-empty-index-arg.rs (renamed from tests/ui/macros/rfc-3086-metavar-expr/issue-111904.rs)6
-rw-r--r--tests/ui/macros/metavar-expressions/count-empty-index-arg.stderr (renamed from tests/ui/macros/rfc-3086-metavar-expr/issue-111904.stderr)4
-rw-r--r--tests/ui/macros/metavar-expressions/dollar-dollar-has-correct-behavior.rs (renamed from tests/ui/macros/rfc-3086-metavar-expr/dollar-dollar-has-correct-behavior.rs)0
-rw-r--r--tests/ui/macros/metavar-expressions/feature-gate-macro_metavar_expr.rs (renamed from tests/ui/macros/rfc-3086-metavar-expr/feature-gate-macro_metavar_expr.rs)0
-rw-r--r--tests/ui/macros/metavar-expressions/macro-expansion.rs (renamed from tests/ui/macros/rfc-3086-metavar-expr/macro-expansion.rs)0
-rw-r--r--tests/ui/macros/metavar-expressions/out-of-bounds-arguments.rs (renamed from tests/ui/macros/rfc-3086-metavar-expr/out-of-bounds-arguments.rs)0
-rw-r--r--tests/ui/macros/metavar-expressions/out-of-bounds-arguments.stderr (renamed from tests/ui/macros/rfc-3086-metavar-expr/out-of-bounds-arguments.stderr)0
-rw-r--r--tests/ui/macros/metavar-expressions/required-feature.rs (renamed from tests/ui/macros/rfc-3086-metavar-expr/required-feature.rs)0
-rw-r--r--tests/ui/macros/metavar-expressions/required-feature.stderr (renamed from tests/ui/macros/rfc-3086-metavar-expr/required-feature.stderr)0
-rw-r--r--tests/ui/macros/metavar-expressions/syntax-errors.rs (renamed from tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.rs)0
-rw-r--r--tests/ui/macros/metavar-expressions/syntax-errors.stderr (renamed from tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.stderr)0
23 files changed, 57 insertions, 56 deletions
diff --git a/src/tools/tidy/src/issues.txt b/src/tools/tidy/src/issues.txt
index b3517b2e9da..0f908e4f551 100644
--- a/src/tools/tidy/src/issues.txt
+++ b/src/tools/tidy/src/issues.txt
@@ -2849,7 +2849,6 @@ ui/macros/issue-98466.rs
 ui/macros/issue-99261.rs
 ui/macros/issue-99265.rs
 ui/macros/issue-99907.rs
-ui/macros/rfc-3086-metavar-expr/issue-111904.rs
 ui/malformed/issue-107423-unused-delim-only-one-no-pair.rs
 ui/malformed/issue-69341-malformed-derive-inert.rs
 ui/marker_trait_attr/issue-61651-type-mismatch.rs
diff --git a/tests/ui/macros/macro-metavar-expr-concat/allowed-operations.rs b/tests/ui/macros/metavar-expressions/concat-allowed-operations.rs
index 695a752fe17..695a752fe17 100644
--- a/tests/ui/macros/macro-metavar-expr-concat/allowed-operations.rs
+++ b/tests/ui/macros/metavar-expressions/concat-allowed-operations.rs
diff --git a/tests/ui/macros/macro-metavar-expr-concat/hygiene.rs b/tests/ui/macros/metavar-expressions/concat-hygiene.rs
index 24b0e36498a..24b0e36498a 100644
--- a/tests/ui/macros/macro-metavar-expr-concat/hygiene.rs
+++ b/tests/ui/macros/metavar-expressions/concat-hygiene.rs
diff --git a/tests/ui/macros/macro-metavar-expr-concat/hygiene.stderr b/tests/ui/macros/metavar-expressions/concat-hygiene.stderr
index ef2326dce85..f3150d385ee 100644
--- a/tests/ui/macros/macro-metavar-expr-concat/hygiene.stderr
+++ b/tests/ui/macros/metavar-expressions/concat-hygiene.stderr
@@ -1,5 +1,5 @@
 error[E0425]: cannot find value `abcdef` in this scope
-  --> $DIR/hygiene.rs:5:10
+  --> $DIR/concat-hygiene.rs:5:10
    |
 LL |         ${concat($lhs, $rhs)}
    |          ^^^^^^^^^^^^^^^^^^^^ not found in this scope
diff --git a/tests/ui/macros/macro-metavar-expr-concat/raw-identifiers.rs b/tests/ui/macros/metavar-expressions/concat-raw-identifiers.rs
index b1cb2141cc4..b1cb2141cc4 100644
--- a/tests/ui/macros/macro-metavar-expr-concat/raw-identifiers.rs
+++ b/tests/ui/macros/metavar-expressions/concat-raw-identifiers.rs
diff --git a/tests/ui/macros/macro-metavar-expr-concat/raw-identifiers.stderr b/tests/ui/macros/metavar-expressions/concat-raw-identifiers.stderr
index 4e11e20acc5..7abab6a5103 100644
--- a/tests/ui/macros/macro-metavar-expr-concat/raw-identifiers.stderr
+++ b/tests/ui/macros/metavar-expressions/concat-raw-identifiers.stderr
@@ -1,47 +1,47 @@
 error: expected identifier or string literal
-  --> $DIR/raw-identifiers.rs:28:22
+  --> $DIR/concat-raw-identifiers.rs:28:22
    |
 LL |         let ${concat(r#abc, abc)}: () = ();
    |                      ^^^^^
 
 error: expected identifier or string literal
-  --> $DIR/raw-identifiers.rs:32:27
+  --> $DIR/concat-raw-identifiers.rs:32:27
    |
 LL |         let ${concat(abc, r#abc)}: () = ();
    |                           ^^^^^
 
 error: expected identifier or string literal
-  --> $DIR/raw-identifiers.rs:35:22
+  --> $DIR/concat-raw-identifiers.rs:35:22
    |
 LL |         let ${concat(r#abc, r#abc)}: () = ();
    |                      ^^^^^
 
 error: `${concat(..)}` currently does not support raw identifiers
-  --> $DIR/raw-identifiers.rs:5:28
+  --> $DIR/concat-raw-identifiers.rs:5:28
    |
 LL |         let ${concat(abc, $rhs)}: () = ();
    |                            ^^^
 
 error: `${concat(..)}` currently does not support raw identifiers
-  --> $DIR/raw-identifiers.rs:12:23
+  --> $DIR/concat-raw-identifiers.rs:12:23
    |
 LL |         let ${concat($lhs, abc)}: () = ();
    |                       ^^^
 
 error: `${concat(..)}` currently does not support raw identifiers
-  --> $DIR/raw-identifiers.rs:19:23
+  --> $DIR/concat-raw-identifiers.rs:19:23
    |
 LL |         let ${concat($lhs, $rhs)}: () = ();
    |                       ^^^
 
 error: `${concat(..)}` currently does not support raw identifiers
-  --> $DIR/raw-identifiers.rs:19:29
+  --> $DIR/concat-raw-identifiers.rs:19:29
    |
 LL |         let ${concat($lhs, $rhs)}: () = ();
    |                             ^^^
 
 error: `${concat(..)}` currently does not support raw identifiers
-  --> $DIR/raw-identifiers.rs:19:23
+  --> $DIR/concat-raw-identifiers.rs:19:23
    |
 LL |         let ${concat($lhs, $rhs)}: () = ();
    |                       ^^^
@@ -49,31 +49,31 @@ LL |         let ${concat($lhs, $rhs)}: () = ();
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error: `${concat(..)}` currently does not support raw identifiers
-  --> $DIR/raw-identifiers.rs:42:28
+  --> $DIR/concat-raw-identifiers.rs:42:28
    |
 LL |         let ${concat(abc, $rhs)}: () = ();
    |                            ^^^
 
 error: `${concat(..)}` currently does not support raw identifiers
-  --> $DIR/raw-identifiers.rs:49:23
+  --> $DIR/concat-raw-identifiers.rs:49:23
    |
 LL |         let ${concat($lhs, abc)}: () = ();
    |                       ^^^
 
 error: `${concat(..)}` currently does not support raw identifiers
-  --> $DIR/raw-identifiers.rs:56:23
+  --> $DIR/concat-raw-identifiers.rs:56:23
    |
 LL |         let ${concat($lhs, $rhs)}: () = ();
    |                       ^^^
 
 error: `${concat(..)}` currently does not support raw identifiers
-  --> $DIR/raw-identifiers.rs:56:29
+  --> $DIR/concat-raw-identifiers.rs:56:29
    |
 LL |         let ${concat($lhs, $rhs)}: () = ();
    |                             ^^^
 
 error: `${concat(..)}` currently does not support raw identifiers
-  --> $DIR/raw-identifiers.rs:56:23
+  --> $DIR/concat-raw-identifiers.rs:56:23
    |
 LL |         let ${concat($lhs, $rhs)}: () = ();
    |                       ^^^
@@ -81,7 +81,7 @@ LL |         let ${concat($lhs, $rhs)}: () = ();
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error: expected pattern, found `$`
-  --> $DIR/raw-identifiers.rs:28:13
+  --> $DIR/concat-raw-identifiers.rs:28:13
    |
 LL |         let ${concat(r#abc, abc)}: () = ();
    |             ^ expected pattern
diff --git a/tests/ui/macros/macro-metavar-expr-concat/repetitions.rs b/tests/ui/macros/metavar-expressions/concat-repetitions.rs
index 52a7d5cd8a7..52a7d5cd8a7 100644
--- a/tests/ui/macros/macro-metavar-expr-concat/repetitions.rs
+++ b/tests/ui/macros/metavar-expressions/concat-repetitions.rs
diff --git a/tests/ui/macros/macro-metavar-expr-concat/repetitions.stderr b/tests/ui/macros/metavar-expressions/concat-repetitions.stderr
index c3006c4be5d..18b0a90c1c8 100644
--- a/tests/ui/macros/macro-metavar-expr-concat/repetitions.stderr
+++ b/tests/ui/macros/metavar-expressions/concat-repetitions.stderr
@@ -1,17 +1,17 @@
 error: invalid syntax
-  --> $DIR/repetitions.rs:14:20
+  --> $DIR/concat-repetitions.rs:14:20
    |
 LL |             const ${concat($a, Z)}: i32 = 3;
    |                    ^^^^^^^^^^^^^^^
 
 error: invalid syntax
-  --> $DIR/repetitions.rs:22:17
+  --> $DIR/concat-repetitions.rs:22:17
    |
 LL |         read::<${concat($t, $en)}>()
    |                 ^^^^^^^^^^^^^^^^^
 
 error: invalid syntax
-  --> $DIR/repetitions.rs:22:17
+  --> $DIR/concat-repetitions.rs:22:17
    |
 LL |         read::<${concat($t, $en)}>()
    |                 ^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/macros/macro-metavar-expr-concat/syntax-errors.rs b/tests/ui/macros/metavar-expressions/concat-syntax-errors.rs
index 7673bd3200f..7673bd3200f 100644
--- a/tests/ui/macros/macro-metavar-expr-concat/syntax-errors.rs
+++ b/tests/ui/macros/metavar-expressions/concat-syntax-errors.rs
diff --git a/tests/ui/macros/macro-metavar-expr-concat/syntax-errors.stderr b/tests/ui/macros/metavar-expressions/concat-syntax-errors.stderr
index 2de6d2b3ce3..3297de80186 100644
--- a/tests/ui/macros/macro-metavar-expr-concat/syntax-errors.stderr
+++ b/tests/ui/macros/metavar-expressions/concat-syntax-errors.stderr
@@ -1,71 +1,71 @@
 error: expected identifier or string literal
-  --> $DIR/syntax-errors.rs:5:10
+  --> $DIR/concat-syntax-errors.rs:5:10
    |
 LL |         ${concat()}
    |          ^^^^^^^^^^
 
 error: `concat` must have at least two elements
-  --> $DIR/syntax-errors.rs:8:11
+  --> $DIR/concat-syntax-errors.rs:8:11
    |
 LL |         ${concat(aaaa)}
    |           ^^^^^^
 
 error: expected identifier or string literal
-  --> $DIR/syntax-errors.rs:11:10
+  --> $DIR/concat-syntax-errors.rs:11:10
    |
 LL |         ${concat(aaaa,)}
    |          ^^^^^^^^^^^^^^^
 
 error: expected comma
-  --> $DIR/syntax-errors.rs:16:10
+  --> $DIR/concat-syntax-errors.rs:16:10
    |
 LL |         ${concat(aaaa aaaa)}
    |          ^^^^^^^^^^^^^^^^^^^
 
 error: `concat` must have at least two elements
-  --> $DIR/syntax-errors.rs:19:11
+  --> $DIR/concat-syntax-errors.rs:19:11
    |
 LL |         ${concat($ex)}
    |           ^^^^^^
 
 error: expected comma
-  --> $DIR/syntax-errors.rs:25:10
+  --> $DIR/concat-syntax-errors.rs:25:10
    |
 LL |         ${concat($ex, aaaa 123)}
    |          ^^^^^^^^^^^^^^^^^^^^^^^
 
 error: expected identifier or string literal
-  --> $DIR/syntax-errors.rs:28:10
+  --> $DIR/concat-syntax-errors.rs:28:10
    |
 LL |         ${concat($ex, aaaa,)}
    |          ^^^^^^^^^^^^^^^^^^^^
 
 error: expected identifier or string literal
-  --> $DIR/syntax-errors.rs:88:26
+  --> $DIR/concat-syntax-errors.rs:88:26
    |
 LL |         let ${concat(_a, 'b')}: () = ();
    |                          ^^^
 
 error: expected identifier or string literal
-  --> $DIR/syntax-errors.rs:91:26
+  --> $DIR/concat-syntax-errors.rs:91:26
    |
 LL |         let ${concat(_a, 1)}: () = ();
    |                          ^
 
 error: expected identifier or string literal
-  --> $DIR/syntax-errors.rs:94:30
+  --> $DIR/concat-syntax-errors.rs:94:30
    |
 LL |         let ${concat($ident, 'b')}: () = ();
    |                              ^^^
 
 error: expected identifier or string literal
-  --> $DIR/syntax-errors.rs:96:30
+  --> $DIR/concat-syntax-errors.rs:96:30
    |
 LL |         let ${concat($ident, 1)}: () = ();
    |                              ^
 
 error: metavariables of `${concat(..)}` must be of type `ident`, `literal` or `tt`
-  --> $DIR/syntax-errors.rs:22:19
+  --> $DIR/concat-syntax-errors.rs:22:19
    |
 LL |         ${concat($ex, aaaa)}
    |                   ^^
@@ -73,13 +73,13 @@ LL |         ${concat($ex, aaaa)}
    = note: currently only string literals are supported
 
 error: variable `foo` is not recognized in meta-variable expression
-  --> $DIR/syntax-errors.rs:35:30
+  --> $DIR/concat-syntax-errors.rs:35:30
    |
 LL |         const ${concat(FOO, $foo)}: i32 = 2;
    |                              ^^^
 
 error: `${concat(..)}` is not generating a valid identifier
-  --> $DIR/syntax-errors.rs:42:14
+  --> $DIR/concat-syntax-errors.rs:42:14
    |
 LL |         let ${concat("1", $ident)}: () = ();
    |              ^^^^^^^^^^^^^^^^^^^^^
@@ -90,7 +90,7 @@ LL |     starting_number!(_abc);
    = note: this error originates in the macro `starting_number` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: `${concat(..)}` is not generating a valid identifier
-  --> $DIR/syntax-errors.rs:55:14
+  --> $DIR/concat-syntax-errors.rs:55:14
    |
 LL |         let ${concat("\u{00BD}", $ident)}: () = ();
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -101,7 +101,7 @@ LL |     starting_invalid_unicode!(_abc);
    = note: this error originates in the macro `starting_invalid_unicode` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: `${concat(..)}` is not generating a valid identifier
-  --> $DIR/syntax-errors.rs:74:14
+  --> $DIR/concat-syntax-errors.rs:74:14
    |
 LL |         let ${concat($ident, "\u{00BD}")}: () = ();
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -112,7 +112,7 @@ LL |     ending_invalid_unicode!(_abc);
    = note: this error originates in the macro `ending_invalid_unicode` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: expected pattern, found `$`
-  --> $DIR/syntax-errors.rs:88:13
+  --> $DIR/concat-syntax-errors.rs:88:13
    |
 LL |         let ${concat(_a, 'b')}: () = ();
    |             ^ expected pattern
@@ -123,7 +123,7 @@ LL |     unsupported_literals!(_abc);
    = note: this error originates in the macro `unsupported_literals` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: `${concat(..)}` is not generating a valid identifier
-  --> $DIR/syntax-errors.rs:81:14
+  --> $DIR/concat-syntax-errors.rs:81:14
    |
 LL |         let ${concat("", "")}: () = ();
    |              ^^^^^^^^^^^^^^^^
@@ -134,7 +134,7 @@ LL |     empty!();
    = note: this error originates in the macro `empty` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: `${concat(..)}` is not generating a valid identifier
-  --> $DIR/syntax-errors.rs:103:16
+  --> $DIR/concat-syntax-errors.rs:103:16
    |
 LL |         const ${concat(_foo, $literal)}: () = ();
    |                ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -145,7 +145,7 @@ LL |     bad_literal_string!("\u{00BD}");
    = note: this error originates in the macro `bad_literal_string` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: `${concat(..)}` is not generating a valid identifier
-  --> $DIR/syntax-errors.rs:103:16
+  --> $DIR/concat-syntax-errors.rs:103:16
    |
 LL |         const ${concat(_foo, $literal)}: () = ();
    |                ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -156,7 +156,7 @@ LL |     bad_literal_string!("\x41");
    = note: this error originates in the macro `bad_literal_string` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: `${concat(..)}` is not generating a valid identifier
-  --> $DIR/syntax-errors.rs:103:16
+  --> $DIR/concat-syntax-errors.rs:103:16
    |
 LL |         const ${concat(_foo, $literal)}: () = ();
    |                ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -167,7 +167,7 @@ LL |     bad_literal_string!("🤷");
    = note: this error originates in the macro `bad_literal_string` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: `${concat(..)}` is not generating a valid identifier
-  --> $DIR/syntax-errors.rs:103:16
+  --> $DIR/concat-syntax-errors.rs:103:16
    |
 LL |         const ${concat(_foo, $literal)}: () = ();
    |                ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -178,7 +178,7 @@ LL |     bad_literal_string!("d[-_-]b");
    = note: this error originates in the macro `bad_literal_string` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: `${concat(..)}` is not generating a valid identifier
-  --> $DIR/syntax-errors.rs:103:16
+  --> $DIR/concat-syntax-errors.rs:103:16
    |
 LL |         const ${concat(_foo, $literal)}: () = ();
    |                ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -189,7 +189,7 @@ LL |     bad_literal_string!("-1");
    = note: this error originates in the macro `bad_literal_string` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: `${concat(..)}` is not generating a valid identifier
-  --> $DIR/syntax-errors.rs:103:16
+  --> $DIR/concat-syntax-errors.rs:103:16
    |
 LL |         const ${concat(_foo, $literal)}: () = ();
    |                ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -200,7 +200,7 @@ LL |     bad_literal_string!("1.0");
    = note: this error originates in the macro `bad_literal_string` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: `${concat(..)}` is not generating a valid identifier
-  --> $DIR/syntax-errors.rs:103:16
+  --> $DIR/concat-syntax-errors.rs:103:16
    |
 LL |         const ${concat(_foo, $literal)}: () = ();
    |                ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -211,7 +211,7 @@ LL |     bad_literal_string!("'1'");
    = note: this error originates in the macro `bad_literal_string` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: metavariables of `${concat(..)}` must be of type `ident`, `literal` or `tt`
-  --> $DIR/syntax-errors.rs:116:31
+  --> $DIR/concat-syntax-errors.rs:116:31
    |
 LL |         const ${concat(_foo, $literal)}: () = ();
    |                               ^^^^^^^
@@ -219,7 +219,7 @@ LL |         const ${concat(_foo, $literal)}: () = ();
    = note: currently only string literals are supported
 
 error: metavariables of `${concat(..)}` must be of type `ident`, `literal` or `tt`
-  --> $DIR/syntax-errors.rs:116:31
+  --> $DIR/concat-syntax-errors.rs:116:31
    |
 LL |         const ${concat(_foo, $literal)}: () = ();
    |                               ^^^^^^^
@@ -228,7 +228,7 @@ LL |         const ${concat(_foo, $literal)}: () = ();
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error: metavariables of `${concat(..)}` must be of type `ident`, `literal` or `tt`
-  --> $DIR/syntax-errors.rs:116:31
+  --> $DIR/concat-syntax-errors.rs:116:31
    |
 LL |         const ${concat(_foo, $literal)}: () = ();
    |                               ^^^^^^^
@@ -237,7 +237,7 @@ LL |         const ${concat(_foo, $literal)}: () = ();
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error: metavariables of `${concat(..)}` must be of type `ident`, `literal` or `tt`
-  --> $DIR/syntax-errors.rs:116:31
+  --> $DIR/concat-syntax-errors.rs:116:31
    |
 LL |         const ${concat(_foo, $literal)}: () = ();
    |                               ^^^^^^^
@@ -246,7 +246,7 @@ LL |         const ${concat(_foo, $literal)}: () = ();
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error: metavariables of `${concat(..)}` must be of type `ident`, `literal` or `tt`
-  --> $DIR/syntax-errors.rs:116:31
+  --> $DIR/concat-syntax-errors.rs:116:31
    |
 LL |         const ${concat(_foo, $literal)}: () = ();
    |                               ^^^^^^^
@@ -255,7 +255,7 @@ LL |         const ${concat(_foo, $literal)}: () = ();
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error: metavariables of `${concat(..)}` must be of type `ident`, `literal` or `tt`
-  --> $DIR/syntax-errors.rs:127:31
+  --> $DIR/concat-syntax-errors.rs:127:31
    |
 LL |         const ${concat(_foo, $tt)}: () = ();
    |                               ^^
@@ -263,7 +263,7 @@ LL |         const ${concat(_foo, $tt)}: () = ();
    = note: currently only string literals are supported
 
 error: metavariables of `${concat(..)}` must be of type `ident`, `literal` or `tt`
-  --> $DIR/syntax-errors.rs:127:31
+  --> $DIR/concat-syntax-errors.rs:127:31
    |
 LL |         const ${concat(_foo, $tt)}: () = ();
    |                               ^^
@@ -272,7 +272,7 @@ LL |         const ${concat(_foo, $tt)}: () = ();
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error: metavariables of `${concat(..)}` must be of type `ident`, `literal` or `tt`
-  --> $DIR/syntax-errors.rs:127:31
+  --> $DIR/concat-syntax-errors.rs:127:31
    |
 LL |         const ${concat(_foo, $tt)}: () = ();
    |                               ^^
diff --git a/tests/ui/macros/macro-metavar-expr-concat/unicode-expansion.rs b/tests/ui/macros/metavar-expressions/concat-unicode-expansion.rs
index 4eeb2384deb..4eeb2384deb 100644
--- a/tests/ui/macros/macro-metavar-expr-concat/unicode-expansion.rs
+++ b/tests/ui/macros/metavar-expressions/concat-unicode-expansion.rs
diff --git a/tests/ui/macros/rfc-3086-metavar-expr/count-and-length-are-distinct.rs b/tests/ui/macros/metavar-expressions/count-and-length-are-distinct.rs
index 8ca453273cd..8ca453273cd 100644
--- a/tests/ui/macros/rfc-3086-metavar-expr/count-and-length-are-distinct.rs
+++ b/tests/ui/macros/metavar-expressions/count-and-length-are-distinct.rs
diff --git a/tests/ui/macros/rfc-3086-metavar-expr/issue-111904.rs b/tests/ui/macros/metavar-expressions/count-empty-index-arg.rs
index 3000bfed6a8..69880ee7fa9 100644
--- a/tests/ui/macros/rfc-3086-metavar-expr/issue-111904.rs
+++ b/tests/ui/macros/metavar-expressions/count-empty-index-arg.rs
@@ -1,3 +1,6 @@
+// Issue: https://github.com/rust-lang/rust/issues/111904
+// Ensure that a trailing `,` is not interpreted as a `0`.
+
 #![feature(macro_metavar_expr)]
 
 macro_rules! foo {
@@ -10,5 +13,4 @@ fn test() {
     foo!(a, a; b, b);
 }
 
-fn main() {
-}
+fn main() {}
diff --git a/tests/ui/macros/rfc-3086-metavar-expr/issue-111904.stderr b/tests/ui/macros/metavar-expressions/count-empty-index-arg.stderr
index fd53c1686cf..e1f9d020b7f 100644
--- a/tests/ui/macros/rfc-3086-metavar-expr/issue-111904.stderr
+++ b/tests/ui/macros/metavar-expressions/count-empty-index-arg.stderr
@@ -1,11 +1,11 @@
 error: `count` followed by a comma must have an associated index indicating its depth
-  --> $DIR/issue-111904.rs:4:37
+  --> $DIR/count-empty-index-arg.rs:7:37
    |
 LL |     ( $( $($t:ident),* );* ) => { ${count($t,)} }
    |                                     ^^^^^
 
 error: expected expression, found `$`
-  --> $DIR/issue-111904.rs:4:35
+  --> $DIR/count-empty-index-arg.rs:7:35
    |
 LL |     ( $( $($t:ident),* );* ) => { ${count($t,)} }
    |                                   ^ expected expression
diff --git a/tests/ui/macros/rfc-3086-metavar-expr/dollar-dollar-has-correct-behavior.rs b/tests/ui/macros/metavar-expressions/dollar-dollar-has-correct-behavior.rs
index 9b8e3216a68..9b8e3216a68 100644
--- a/tests/ui/macros/rfc-3086-metavar-expr/dollar-dollar-has-correct-behavior.rs
+++ b/tests/ui/macros/metavar-expressions/dollar-dollar-has-correct-behavior.rs
diff --git a/tests/ui/macros/rfc-3086-metavar-expr/feature-gate-macro_metavar_expr.rs b/tests/ui/macros/metavar-expressions/feature-gate-macro_metavar_expr.rs
index 51445221c57..51445221c57 100644
--- a/tests/ui/macros/rfc-3086-metavar-expr/feature-gate-macro_metavar_expr.rs
+++ b/tests/ui/macros/metavar-expressions/feature-gate-macro_metavar_expr.rs
diff --git a/tests/ui/macros/rfc-3086-metavar-expr/macro-expansion.rs b/tests/ui/macros/metavar-expressions/macro-expansion.rs
index 1d34275874b..1d34275874b 100644
--- a/tests/ui/macros/rfc-3086-metavar-expr/macro-expansion.rs
+++ b/tests/ui/macros/metavar-expressions/macro-expansion.rs
diff --git a/tests/ui/macros/rfc-3086-metavar-expr/out-of-bounds-arguments.rs b/tests/ui/macros/metavar-expressions/out-of-bounds-arguments.rs
index 0caa3ea89e4..0caa3ea89e4 100644
--- a/tests/ui/macros/rfc-3086-metavar-expr/out-of-bounds-arguments.rs
+++ b/tests/ui/macros/metavar-expressions/out-of-bounds-arguments.rs
diff --git a/tests/ui/macros/rfc-3086-metavar-expr/out-of-bounds-arguments.stderr b/tests/ui/macros/metavar-expressions/out-of-bounds-arguments.stderr
index 0b441cad083..0b441cad083 100644
--- a/tests/ui/macros/rfc-3086-metavar-expr/out-of-bounds-arguments.stderr
+++ b/tests/ui/macros/metavar-expressions/out-of-bounds-arguments.stderr
diff --git a/tests/ui/macros/rfc-3086-metavar-expr/required-feature.rs b/tests/ui/macros/metavar-expressions/required-feature.rs
index 77c165e3855..77c165e3855 100644
--- a/tests/ui/macros/rfc-3086-metavar-expr/required-feature.rs
+++ b/tests/ui/macros/metavar-expressions/required-feature.rs
diff --git a/tests/ui/macros/rfc-3086-metavar-expr/required-feature.stderr b/tests/ui/macros/metavar-expressions/required-feature.stderr
index f28f822a058..f28f822a058 100644
--- a/tests/ui/macros/rfc-3086-metavar-expr/required-feature.stderr
+++ b/tests/ui/macros/metavar-expressions/required-feature.stderr
diff --git a/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.rs b/tests/ui/macros/metavar-expressions/syntax-errors.rs
index 78cede92526..78cede92526 100644
--- a/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.rs
+++ b/tests/ui/macros/metavar-expressions/syntax-errors.rs
diff --git a/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.stderr b/tests/ui/macros/metavar-expressions/syntax-errors.stderr
index d9646760cea..d9646760cea 100644
--- a/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.stderr
+++ b/tests/ui/macros/metavar-expressions/syntax-errors.stderr