Skip to content

Commit 1a03432

Browse files
committedJul 1, 2020
Amend wording of note
1 parent a1217cb commit 1a03432

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎src/librustc_builtin_macros/format.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ impl<'a, 'b> Context<'a, 'b> {
537537
name
538538
));
539539
err.note(
540-
"for hygiene reasons format_args! cannot capture variables \
540+
"to avoid ambiguity format_args! cannot capture variables \
541541
when the format string is expanded from a macro",
542542
);
543543
} else if self.ecx.parse_sess().unstable_features.is_nightly_build() {

‎src/test/ui/fmt/format-args-capture-macro-hygiene.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | format!(concat!("{foo}"));
55
| ^^^^^^^^^^^^^^^^
66
|
77
= note: did you intend to capture a variable `foo` from the surrounding scope?
8-
= note: for hygiene reasons format_args! cannot capture variables when the format string is expanded from a macro
8+
= note: to avoid ambiguity format_args! cannot capture variables when the format string is expanded from a macro
99
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
1010

1111
error: there is no argument named `bar`
@@ -15,7 +15,7 @@ LL | format!(concat!("{ba", "r} {}"), 1);
1515
| ^^^^^^^^^^^^^^^^^^^^^^^
1616
|
1717
= note: did you intend to capture a variable `bar` from the surrounding scope?
18-
= note: for hygiene reasons format_args! cannot capture variables when the format string is expanded from a macro
18+
= note: to avoid ambiguity format_args! cannot capture variables when the format string is expanded from a macro
1919
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
2020

2121
error: aborting due to 2 previous errors

0 commit comments

Comments
 (0)
Please sign in to comment.