提交 10ebb2cb 编写于 作者: D David Hewitt

Update src/librustc_builtin_macros/format.rs

Apply suggestion from varkor
Co-authored-by: Nvarkor <github@varkor.com>
上级 1a034321
......@@ -537,7 +537,7 @@ fn verify_arg_type(&mut self, arg: Position, ty: ArgumentType) {
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() {
......
......@@ -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`
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册