1
1
error: 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
3
3
|
4
4
LL | format!(concat!("{foo}"));
5
5
| ^^^^^^^^^^^^^^^^
@@ -9,7 +9,7 @@ LL | format!(concat!("{foo}"));
9
9
= note: this error originates in the macro `concat` (in Nightly builds, run with -Z macro-backtrace for more info)
10
10
11
11
error: 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
13
13
|
14
14
LL | format!(concat!("{ba", "r} {}"), 1);
15
15
| ^^^^^^^^^^^^^^^^^^^^^^^
@@ -18,5 +18,36 @@ LL | format!(concat!("{ba", "r} {}"), 1);
18
18
= note: to avoid ambiguity, `format_args!` cannot capture variables when the format string is expanded from a macro
19
19
= note: this error originates in the macro `concat` (in Nightly builds, run with -Z macro-backtrace for more info)
20
20
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
22
53
0 commit comments