diff options
| author | David Hewitt <1939362+davidhewitt@users.noreply.github.com> | 2020-06-30 23:33:26 +0100 |
|---|---|---|
| committer | David Hewitt <1939362+davidhewitt@users.noreply.github.com> | 2020-07-01 07:39:56 +0100 |
| commit | 1a0343217d34b5ef60bf7c0a86376dcddf90b8cd (patch) | |
| tree | be22329ab780f50e2b8150a957d18ff0bcf10dcc | |
| parent | a1217cb29de22aae3cda717e78d1edd3e9d8ffd1 (diff) | |
| download | rust-1a0343217d34b5ef60bf7c0a86376dcddf90b8cd.tar.gz rust-1a0343217d34b5ef60bf7c0a86376dcddf90b8cd.zip | |
Amend wording of note
| -rw-r--r-- | src/librustc_builtin_macros/format.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/fmt/format-args-capture-macro-hygiene.stderr | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_builtin_macros/format.rs b/src/librustc_builtin_macros/format.rs index 16e11fecf29..019432035fe 100644 --- a/src/librustc_builtin_macros/format.rs +++ b/src/librustc_builtin_macros/format.rs @@ -537,7 +537,7 @@ impl<'a, 'b> Context<'a, 'b> { name )); err.note( - "for hygiene reasons 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() { diff --git a/src/test/ui/fmt/format-args-capture-macro-hygiene.stderr b/src/test/ui/fmt/format-args-capture-macro-hygiene.stderr index 42039c33d2f..55bd97bafe8 100644 --- a/src/test/ui/fmt/format-args-capture-macro-hygiene.stderr +++ b/src/test/ui/fmt/format-args-capture-macro-hygiene.stderr @@ -5,7 +5,7 @@ LL | format!(concat!("{foo}")); | ^^^^^^^^^^^^^^^^ | = note: did you intend to capture a variable `foo` from the surrounding scope? - = note: for hygiene reasons 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: for hygiene reasons 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 |
