Consistently call editions "Rust 20xx" in messages.

This commit is contained in:
Mara Bos 2020-11-30 22:11:29 +01:00
parent f16ef7d7ce
commit c574ded57d
8 changed files with 31 additions and 31 deletions

View file

@ -2109,7 +2109,7 @@ impl<'a> Parser<'a> {
let mut async_block_err = |e: &mut DiagnosticBuilder<'_>, span: Span| {
recover_async = true;
e.span_label(span, "`async` blocks are only allowed in edition 2018 or later");
e.span_label(span, "`async` blocks are only allowed in Rust 2018 or later");
e.help(&format!("set `edition = \"{}\"` in `Cargo.toml`", LATEST_STABLE_EDITION));
e.note("for more on editions, read https://doc.rust-lang.org/edition-guide");
};

View file

@ -1667,7 +1667,7 @@ impl<'a> Parser<'a> {
fn ban_async_in_2015(&self, span: Span) {
if span.rust_2015() {
let diag = self.diagnostic();
struct_span_err!(diag, span, E0670, "`async fn` is not permitted in the 2015 edition")
struct_span_err!(diag, span, E0670, "`async fn` is not permitted in Rust 2015")
.span_label(span, "to use `async fn`, switch to Rust 2018 or later")
.help(&format!("set `edition = \"{}\"` in `Cargo.toml`", LATEST_STABLE_EDITION))
.note("for more on editions, read https://doc.rust-lang.org/edition-guide")