about summary refs log tree commit diff
path: root/tests/ui/fmt
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2023-12-26 16:30:31 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2024-02-18 11:19:24 +0300
commit9f8d05f29f9df6ff46455d7e9e3b25464c1e28ec (patch)
tree55c68e7e49772f5094bcc12ebadaeaa31b2ad5c4 /tests/ui/fmt
parent23a3d777c8a95715977608c827de63e7738fa228 (diff)
downloadrust-9f8d05f29f9df6ff46455d7e9e3b25464c1e28ec.tar.gz
rust-9f8d05f29f9df6ff46455d7e9e3b25464c1e28ec.zip
macro_rules: Preserve all metavariable spans in a global side table
Diffstat (limited to 'tests/ui/fmt')
-rw-r--r--tests/ui/fmt/format-args-capture-first-literal-is-macro.rs2
-rw-r--r--tests/ui/fmt/format-args-capture-first-literal-is-macro.stderr8
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/ui/fmt/format-args-capture-first-literal-is-macro.rs b/tests/ui/fmt/format-args-capture-first-literal-is-macro.rs
index 5afd21a17e5..3a0b7ba4666 100644
--- a/tests/ui/fmt/format-args-capture-first-literal-is-macro.rs
+++ b/tests/ui/fmt/format-args-capture-first-literal-is-macro.rs
@@ -6,7 +6,6 @@ extern crate format_string_proc_macro;
 macro_rules! identity_mbe {
     ($tt:tt) => {
         $tt
-        //~^ ERROR there is no argument named `a`
     };
 }
 
@@ -16,6 +15,7 @@ fn main() {
     format!(identity_pm!("{a}"));
     //~^ ERROR there is no argument named `a`
     format!(identity_mbe!("{a}"));
+    //~^ ERROR there is no argument named `a`
     format!(concat!("{a}"));
     //~^ ERROR there is no argument named `a`
 }
diff --git a/tests/ui/fmt/format-args-capture-first-literal-is-macro.stderr b/tests/ui/fmt/format-args-capture-first-literal-is-macro.stderr
index 4cf3afad7b8..e399361579f 100644
--- a/tests/ui/fmt/format-args-capture-first-literal-is-macro.stderr
+++ b/tests/ui/fmt/format-args-capture-first-literal-is-macro.stderr
@@ -1,5 +1,5 @@
 error: there is no argument named `a`
-  --> $DIR/format-args-capture-first-literal-is-macro.rs:16:26
+  --> $DIR/format-args-capture-first-literal-is-macro.rs:15:26
    |
 LL |     format!(identity_pm!("{a}"));
    |                          ^^^^^
@@ -8,10 +8,10 @@ LL |     format!(identity_pm!("{a}"));
    = note: to avoid ambiguity, `format_args!` cannot capture variables when the format string is expanded from a macro
 
 error: there is no argument named `a`
-  --> $DIR/format-args-capture-first-literal-is-macro.rs:8:9
+  --> $DIR/format-args-capture-first-literal-is-macro.rs:17:27
    |
-LL |         $tt
-   |         ^^^
+LL |     format!(identity_mbe!("{a}"));
+   |                           ^^^^^
    |
    = note: did you intend to capture a variable `a` from the surrounding scope?
    = note: to avoid ambiguity, `format_args!` cannot capture variables when the format string is expanded from a macro