Skip to content

Commit

Permalink
Update src/librustc_builtin_macros/format.rs
Browse files Browse the repository at this point in the history
Apply suggestion from varkor

Co-authored-by: varkor <github@varkor.com>
  • Loading branch information
davidhewitt and varkor committed Jul 1, 2020
1 parent 1a03432 commit 10ebb2c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/librustc_builtin_macros/format.rs
Expand Up @@ -537,7 +537,7 @@ impl<'a, 'b> Context<'a, 'b> {
name
));
err.note(
"to avoid ambiguity format_args! cannot capture variables \
"to avoid ambiguity, `format_args!` cannot capture variables \
when the format string is expanded from a macro",
);
} else if self.ecx.parse_sess().unstable_features.is_nightly_build() {
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/fmt/format-args-capture-macro-hygiene.stderr
Expand Up @@ -5,7 +5,7 @@ LL | format!(concat!("{foo}"));
| ^^^^^^^^^^^^^^^^
|
= note: did you intend to capture a variable `foo` from the surrounding scope?
= note: to avoid ambiguity format_args! cannot capture variables when the format string is expanded from a macro
= note: to avoid ambiguity, `format_args!` cannot capture variables when the format string is expanded from a macro
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

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

error: aborting due to 2 previous errors
Expand Down

0 comments on commit 10ebb2c

Please sign in to comment.