11error: there is no argument named `foo`
2- --> $DIR/format-args-capture-macro-hygiene.rs:2 :13
2+ --> $DIR/format-args-capture-macro-hygiene.rs:15 :13
33 |
44LL | format!(concat!("{foo}"));
55 | ^^^^^^^^^^^^^^^^
@@ -9,7 +9,7 @@ LL | format!(concat!("{foo}"));
99 = note: this error originates in the macro `concat` (in Nightly builds, run with -Z macro-backtrace for more info)
1010
1111error: there is no argument named `bar`
12- --> $DIR/format-args-capture-macro-hygiene.rs:3 :13
12+ --> $DIR/format-args-capture-macro-hygiene.rs:16 :13
1313 |
1414LL | format!(concat!("{ba", "r} {}"), 1);
1515 | ^^^^^^^^^^^^^^^^^^^^^^^
@@ -18,5 +18,36 @@ LL | format!(concat!("{ba", "r} {}"), 1);
1818 = note: to avoid ambiguity, `format_args!` cannot capture variables when the format string is expanded from a macro
1919 = note: this error originates in the macro `concat` (in Nightly builds, run with -Z macro-backtrace for more info)
2020
21- error: aborting due to 2 previous errors
21+ error: there is no argument named `foo`
22+ --> $DIR/format-args-capture-macro-hygiene.rs:7:13
23+ |
24+ LL | () => { "{foo}" }
25+ | ^^^^^^^
26+ ...
27+ LL | format!(def_site!());
28+ | ----------- in this macro invocation
29+ |
30+ = note: did you intend to capture a variable `foo` from the surrounding scope?
31+ = note: to avoid ambiguity, `format_args!` cannot capture variables when the format string is expanded from a macro
32+ = note: this error originates in the macro `def_site` (in Nightly builds, run with -Z macro-backtrace for more info)
33+
34+ error: there is no argument named `foo`
35+ --> $DIR/format-args-capture-macro-hygiene.rs:19:24
36+ |
37+ LL | format!(call_site!("{foo}"));
38+ | ^^^^^^^
39+ |
40+ = note: did you intend to capture a variable `foo` from the surrounding scope?
41+ = note: to avoid ambiguity, `format_args!` cannot capture variables when the format string is expanded from a macro
42+
43+ error: there is no argument named `foo`
44+ --> $DIR/format-args-capture-macro-hygiene.rs:21:34
45+ |
46+ LL | format!(foo_with_input_span!(""));
47+ | ^^
48+ |
49+ = note: did you intend to capture a variable `foo` from the surrounding scope?
50+ = note: to avoid ambiguity, `format_args!` cannot capture variables when the format string is expanded from a macro
51+
52+ error: aborting due to 5 previous errors
2253
0 commit comments