about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEric Huss <eric@huss.org>2019-09-28 09:15:06 -0700
committerEric Huss <eric@huss.org>2019-09-28 09:15:06 -0700
commitf6ceccea935e2ed7f55109b9a2cc2addfe894dff (patch)
tree70f7b6f47694bcda8c388b5a582c5d3ff88aef7c
parentf3c8eba643a815d720e7f20699b3dca144c845c4 (diff)
downloadrust-f6ceccea935e2ed7f55109b9a2cc2addfe894dff.tar.gz
rust-f6ceccea935e2ed7f55109b9a2cc2addfe894dff.zip
Upgrade async/await to "used" keywords.
-rw-r--r--src/libsyntax_pos/symbol.rs8
-rw-r--r--src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.rs14
-rw-r--r--src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.stderr28
-rw-r--r--src/test/ui/async-await/await-keyword/2018-edition-error.rs4
-rw-r--r--src/test/ui/async-await/await-keyword/2018-edition-error.stderr20
-rw-r--r--src/test/ui/async-await/no-const-async.rs2
-rw-r--r--src/test/ui/async-await/no-const-async.stderr4
-rw-r--r--src/test/ui/editions/edition-keywords-2015-2018-expansion.rs2
-rw-r--r--src/test/ui/editions/edition-keywords-2015-2018-expansion.stderr4
-rw-r--r--src/test/ui/editions/edition-keywords-2018-2015-parsing.rs4
-rw-r--r--src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr8
-rw-r--r--src/test/ui/editions/edition-keywords-2018-2018-expansion.rs2
-rw-r--r--src/test/ui/editions/edition-keywords-2018-2018-expansion.stderr4
-rw-r--r--src/test/ui/editions/edition-keywords-2018-2018-parsing.rs4
-rw-r--r--src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr8
-rw-r--r--src/test/ui/parser/mut-patterns.rs2
-rw-r--r--src/test/ui/parser/mut-patterns.stderr4
17 files changed, 61 insertions, 61 deletions
diff --git a/src/libsyntax_pos/symbol.rs b/src/libsyntax_pos/symbol.rs
index 32af930ffb8..44a34070dec 100644
--- a/src/libsyntax_pos/symbol.rs
+++ b/src/libsyntax_pos/symbol.rs
@@ -83,11 +83,11 @@ symbols! {
         Yield:              "yield",
 
         // Edition-specific keywords that are used in stable Rust.
+        Async:              "async", // >= 2018 Edition only
+        Await:              "await", // >= 2018 Edition only
         Dyn:                "dyn", // >= 2018 Edition only
 
         // Edition-specific keywords that are used in unstable Rust or reserved for future use.
-        Async:              "async", // >= 2018 Edition only
-        Await:              "await", // >= 2018 Edition only
         Try:                "try", // >= 2018 Edition only
 
         // Special lifetime names
@@ -1088,11 +1088,11 @@ pub mod sym {
 
 impl Symbol {
     fn is_used_keyword_2018(self) -> bool {
-        self == kw::Dyn
+        self >= kw::Async && self <= kw::Dyn
     }
 
     fn is_unused_keyword_2018(self) -> bool {
-        self >= kw::Async && self <= kw::Try
+        self == kw::Try
     }
 
     /// Used for sanity checking rustdoc keyword sections.
diff --git a/src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.rs b/src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.rs
index 5d85b0a243e..9e78f7c5120 100644
--- a/src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.rs
+++ b/src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.rs
@@ -3,21 +3,21 @@
 #![allow(non_camel_case_types)]
 
 mod outer_mod {
-    pub mod await { //~ ERROR expected identifier, found reserved keyword `await`
-        pub struct await; //~ ERROR expected identifier, found reserved keyword `await`
+    pub mod await { //~ ERROR expected identifier, found keyword `await`
+        pub struct await; //~ ERROR expected identifier, found keyword `await`
     }
 }
-use self::outer_mod::await::await; //~ ERROR expected identifier, found reserved keyword `await`
-//~^ ERROR expected identifier, found reserved keyword `await`
+use self::outer_mod::await::await; //~ ERROR expected identifier, found keyword `await`
+//~^ ERROR expected identifier, found keyword `await`
 
 struct Foo { await: () }
-//~^ ERROR expected identifier, found reserved keyword `await`
+//~^ ERROR expected identifier, found keyword `await`
 
 impl Foo { fn await() {} }
-//~^ ERROR expected identifier, found reserved keyword `await`
+//~^ ERROR expected identifier, found keyword `await`
 
 macro_rules! await {
-//~^ ERROR expected identifier, found reserved keyword `await`
+//~^ ERROR expected identifier, found keyword `await`
     () => {}
 }
 
diff --git a/src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.stderr b/src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.stderr
index 05f28d0a5b2..0e859466322 100644
--- a/src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.stderr
+++ b/src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.stderr
@@ -1,68 +1,68 @@
-error: expected identifier, found reserved keyword `await`
+error: expected identifier, found keyword `await`
   --> $DIR/2018-edition-error-in-non-macro-position.rs:6:13
    |
 LL |     pub mod await {
-   |             ^^^^^ expected identifier, found reserved keyword
+   |             ^^^^^ expected identifier, found keyword
 help: you can escape reserved keywords to use them as identifiers
    |
 LL |     pub mod r#await {
    |             ^^^^^^^
 
-error: expected identifier, found reserved keyword `await`
+error: expected identifier, found keyword `await`
   --> $DIR/2018-edition-error-in-non-macro-position.rs:7:20
    |
 LL |         pub struct await;
-   |                    ^^^^^ expected identifier, found reserved keyword
+   |                    ^^^^^ expected identifier, found keyword
 help: you can escape reserved keywords to use them as identifiers
    |
 LL |         pub struct r#await;
    |                    ^^^^^^^
 
-error: expected identifier, found reserved keyword `await`
+error: expected identifier, found keyword `await`
   --> $DIR/2018-edition-error-in-non-macro-position.rs:10:22
    |
 LL | use self::outer_mod::await::await;
-   |                      ^^^^^ expected identifier, found reserved keyword
+   |                      ^^^^^ expected identifier, found keyword
 help: you can escape reserved keywords to use them as identifiers
    |
 LL | use self::outer_mod::r#await::await;
    |                      ^^^^^^^
 
-error: expected identifier, found reserved keyword `await`
+error: expected identifier, found keyword `await`
   --> $DIR/2018-edition-error-in-non-macro-position.rs:10:29
    |
 LL | use self::outer_mod::await::await;
-   |                             ^^^^^ expected identifier, found reserved keyword
+   |                             ^^^^^ expected identifier, found keyword
 help: you can escape reserved keywords to use them as identifiers
    |
 LL | use self::outer_mod::await::r#await;
    |                             ^^^^^^^
 
-error: expected identifier, found reserved keyword `await`
+error: expected identifier, found keyword `await`
   --> $DIR/2018-edition-error-in-non-macro-position.rs:13:14
    |
 LL | struct Foo { await: () }
-   |              ^^^^^ expected identifier, found reserved keyword
+   |              ^^^^^ expected identifier, found keyword
 help: you can escape reserved keywords to use them as identifiers
    |
 LL | struct Foo { r#await: () }
    |              ^^^^^^^
 
-error: expected identifier, found reserved keyword `await`
+error: expected identifier, found keyword `await`
   --> $DIR/2018-edition-error-in-non-macro-position.rs:16:15
    |
 LL | impl Foo { fn await() {} }
-   |               ^^^^^ expected identifier, found reserved keyword
+   |               ^^^^^ expected identifier, found keyword
 help: you can escape reserved keywords to use them as identifiers
    |
 LL | impl Foo { fn r#await() {} }
    |               ^^^^^^^
 
-error: expected identifier, found reserved keyword `await`
+error: expected identifier, found keyword `await`
   --> $DIR/2018-edition-error-in-non-macro-position.rs:19:14
    |
 LL | macro_rules! await {
-   |              ^^^^^ expected identifier, found reserved keyword
+   |              ^^^^^ expected identifier, found keyword
 help: you can escape reserved keywords to use them as identifiers
    |
 LL | macro_rules! r#await {
diff --git a/src/test/ui/async-await/await-keyword/2018-edition-error.rs b/src/test/ui/async-await/await-keyword/2018-edition-error.rs
index e620c27f9e3..7ce52259aca 100644
--- a/src/test/ui/async-await/await-keyword/2018-edition-error.rs
+++ b/src/test/ui/async-await/await-keyword/2018-edition-error.rs
@@ -7,9 +7,9 @@ mod outer_mod {
     }
 }
 use self::outer_mod::await::await; //~ ERROR expected identifier
-    //~^ ERROR expected identifier, found reserved keyword `await`
+    //~^ ERROR expected identifier, found keyword `await`
 
-macro_rules! await { () => {}; } //~ ERROR expected identifier, found reserved keyword `await`
+macro_rules! await { () => {}; } //~ ERROR expected identifier, found keyword `await`
 
 fn main() {
     await!(); //~ ERROR expected expression, found `)`
diff --git a/src/test/ui/async-await/await-keyword/2018-edition-error.stderr b/src/test/ui/async-await/await-keyword/2018-edition-error.stderr
index 9304928cfde..71f403f278e 100644
--- a/src/test/ui/async-await/await-keyword/2018-edition-error.stderr
+++ b/src/test/ui/async-await/await-keyword/2018-edition-error.stderr
@@ -1,48 +1,48 @@
-error: expected identifier, found reserved keyword `await`
+error: expected identifier, found keyword `await`
   --> $DIR/2018-edition-error.rs:5:13
    |
 LL |     pub mod await {
-   |             ^^^^^ expected identifier, found reserved keyword
+   |             ^^^^^ expected identifier, found keyword
 help: you can escape reserved keywords to use them as identifiers
    |
 LL |     pub mod r#await {
    |             ^^^^^^^
 
-error: expected identifier, found reserved keyword `await`
+error: expected identifier, found keyword `await`
   --> $DIR/2018-edition-error.rs:6:20
    |
 LL |         pub struct await;
-   |                    ^^^^^ expected identifier, found reserved keyword
+   |                    ^^^^^ expected identifier, found keyword
 help: you can escape reserved keywords to use them as identifiers
    |
 LL |         pub struct r#await;
    |                    ^^^^^^^
 
-error: expected identifier, found reserved keyword `await`
+error: expected identifier, found keyword `await`
   --> $DIR/2018-edition-error.rs:9:22
    |
 LL | use self::outer_mod::await::await;
-   |                      ^^^^^ expected identifier, found reserved keyword
+   |                      ^^^^^ expected identifier, found keyword
 help: you can escape reserved keywords to use them as identifiers
    |
 LL | use self::outer_mod::r#await::await;
    |                      ^^^^^^^
 
-error: expected identifier, found reserved keyword `await`
+error: expected identifier, found keyword `await`
   --> $DIR/2018-edition-error.rs:9:29
    |
 LL | use self::outer_mod::await::await;
-   |                             ^^^^^ expected identifier, found reserved keyword
+   |                             ^^^^^ expected identifier, found keyword
 help: you can escape reserved keywords to use them as identifiers
    |
 LL | use self::outer_mod::await::r#await;
    |                             ^^^^^^^
 
-error: expected identifier, found reserved keyword `await`
+error: expected identifier, found keyword `await`
   --> $DIR/2018-edition-error.rs:12:14
    |
 LL | macro_rules! await { () => {}; }
-   |              ^^^^^ expected identifier, found reserved keyword
+   |              ^^^^^ expected identifier, found keyword
 help: you can escape reserved keywords to use them as identifiers
    |
 LL | macro_rules! r#await { () => {}; }
diff --git a/src/test/ui/async-await/no-const-async.rs b/src/test/ui/async-await/no-const-async.rs
index bd78a18a40e..ef7edf85049 100644
--- a/src/test/ui/async-await/no-const-async.rs
+++ b/src/test/ui/async-await/no-const-async.rs
@@ -3,5 +3,5 @@
 // compile-flags: --crate-type lib
 
 pub const async fn x() {}
-//~^ ERROR expected identifier, found reserved keyword `async`
+//~^ ERROR expected identifier, found keyword `async`
 //~^^ expected `:`, found keyword `fn`
diff --git a/src/test/ui/async-await/no-const-async.stderr b/src/test/ui/async-await/no-const-async.stderr
index 6d7df57e7b6..fe059145785 100644
--- a/src/test/ui/async-await/no-const-async.stderr
+++ b/src/test/ui/async-await/no-const-async.stderr
@@ -1,8 +1,8 @@
-error: expected identifier, found reserved keyword `async`
+error: expected identifier, found keyword `async`
   --> $DIR/no-const-async.rs:5:11
    |
 LL | pub const async fn x() {}
-   |           ^^^^^ expected identifier, found reserved keyword
+   |           ^^^^^ expected identifier, found keyword
 help: you can escape reserved keywords to use them as identifiers
    |
 LL | pub const r#async fn x() {}
diff --git a/src/test/ui/editions/edition-keywords-2015-2018-expansion.rs b/src/test/ui/editions/edition-keywords-2015-2018-expansion.rs
index 2684c8e00b2..9f34a3887b7 100644
--- a/src/test/ui/editions/edition-keywords-2015-2018-expansion.rs
+++ b/src/test/ui/editions/edition-keywords-2015-2018-expansion.rs
@@ -5,7 +5,7 @@
 extern crate edition_kw_macro_2018;
 
 mod one_async {
-    produces_async! {} //~ ERROR expected identifier, found reserved keyword
+    produces_async! {} //~ ERROR expected identifier, found keyword
 }
 mod two_async {
     produces_async_raw! {} // OK
diff --git a/src/test/ui/editions/edition-keywords-2015-2018-expansion.stderr b/src/test/ui/editions/edition-keywords-2015-2018-expansion.stderr
index 321545740cf..04a70cf9830 100644
--- a/src/test/ui/editions/edition-keywords-2015-2018-expansion.stderr
+++ b/src/test/ui/editions/edition-keywords-2015-2018-expansion.stderr
@@ -1,8 +1,8 @@
-error: expected identifier, found reserved keyword `async`
+error: expected identifier, found keyword `async`
   --> $DIR/edition-keywords-2015-2018-expansion.rs:8:5
    |
 LL |     produces_async! {}
-   |     ^^^^^^^^^^^^^^^^^^ expected identifier, found reserved keyword
+   |     ^^^^^^^^^^^^^^^^^^ expected identifier, found keyword
    |
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
 help: you can escape reserved keywords to use them as identifiers
diff --git a/src/test/ui/editions/edition-keywords-2018-2015-parsing.rs b/src/test/ui/editions/edition-keywords-2018-2015-parsing.rs
index fb8e0cdb4c3..dbc0465b08e 100644
--- a/src/test/ui/editions/edition-keywords-2018-2015-parsing.rs
+++ b/src/test/ui/editions/edition-keywords-2018-2015-parsing.rs
@@ -5,7 +5,7 @@
 extern crate edition_kw_macro_2015;
 
 pub fn check_async() {
-    let mut async = 1; //~ ERROR expected identifier, found reserved keyword `async`
+    let mut async = 1; //~ ERROR expected identifier, found keyword `async`
     let mut r#async = 1; // OK
 
     r#async = consumes_async!(async); // OK
@@ -15,6 +15,6 @@ pub fn check_async() {
 
     if passes_ident!(async) == 1 {}
     if passes_ident!(r#async) == 1 {} // OK
-    module::async(); //~ ERROR expected identifier, found reserved keyword `async`
+    module::async(); //~ ERROR expected identifier, found keyword `async`
     module::r#async(); // OK
 }
diff --git a/src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr b/src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr
index 3c4a1533534..be991cd0c81 100644
--- a/src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr
+++ b/src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr
@@ -1,18 +1,18 @@
-error: expected identifier, found reserved keyword `async`
+error: expected identifier, found keyword `async`
   --> $DIR/edition-keywords-2018-2015-parsing.rs:8:13
    |
 LL |     let mut async = 1;
-   |             ^^^^^ expected identifier, found reserved keyword
+   |             ^^^^^ expected identifier, found keyword
 help: you can escape reserved keywords to use them as identifiers
    |
 LL |     let mut r#async = 1;
    |             ^^^^^^^
 
-error: expected identifier, found reserved keyword `async`
+error: expected identifier, found keyword `async`
   --> $DIR/edition-keywords-2018-2015-parsing.rs:18:13
    |
 LL |     module::async();
-   |             ^^^^^ expected identifier, found reserved keyword
+   |             ^^^^^ expected identifier, found keyword
 help: you can escape reserved keywords to use them as identifiers
    |
 LL |     module::r#async();
diff --git a/src/test/ui/editions/edition-keywords-2018-2018-expansion.rs b/src/test/ui/editions/edition-keywords-2018-2018-expansion.rs
index 6f766550d47..a8e69fed695 100644
--- a/src/test/ui/editions/edition-keywords-2018-2018-expansion.rs
+++ b/src/test/ui/editions/edition-keywords-2018-2018-expansion.rs
@@ -5,7 +5,7 @@
 extern crate edition_kw_macro_2018;
 
 mod one_async {
-    produces_async! {} //~ ERROR expected identifier, found reserved keyword `async`
+    produces_async! {} //~ ERROR expected identifier, found keyword `async`
 }
 mod two_async {
     produces_async_raw! {} // OK
diff --git a/src/test/ui/editions/edition-keywords-2018-2018-expansion.stderr b/src/test/ui/editions/edition-keywords-2018-2018-expansion.stderr
index 8942e3ce430..fb12051eed4 100644
--- a/src/test/ui/editions/edition-keywords-2018-2018-expansion.stderr
+++ b/src/test/ui/editions/edition-keywords-2018-2018-expansion.stderr
@@ -1,8 +1,8 @@
-error: expected identifier, found reserved keyword `async`
+error: expected identifier, found keyword `async`
   --> $DIR/edition-keywords-2018-2018-expansion.rs:8:5
    |
 LL |     produces_async! {}
-   |     ^^^^^^^^^^^^^^^^^^ expected identifier, found reserved keyword
+   |     ^^^^^^^^^^^^^^^^^^ expected identifier, found keyword
    |
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
 help: you can escape reserved keywords to use them as identifiers
diff --git a/src/test/ui/editions/edition-keywords-2018-2018-parsing.rs b/src/test/ui/editions/edition-keywords-2018-2018-parsing.rs
index 88cebf45ad8..5aca0839f0f 100644
--- a/src/test/ui/editions/edition-keywords-2018-2018-parsing.rs
+++ b/src/test/ui/editions/edition-keywords-2018-2018-parsing.rs
@@ -5,7 +5,7 @@
 extern crate edition_kw_macro_2018;
 
 pub fn check_async() {
-    let mut async = 1; //~ ERROR expected identifier, found reserved keyword `async`
+    let mut async = 1; //~ ERROR expected identifier, found keyword `async`
     let mut r#async = 1; // OK
 
     r#async = consumes_async!(async); // OK
@@ -15,6 +15,6 @@ pub fn check_async() {
 
     if passes_ident!(async) == 1 {}
     if passes_ident!(r#async) == 1 {} // OK
-    module::async(); //~ ERROR expected identifier, found reserved keyword `async`
+    module::async(); //~ ERROR expected identifier, found keyword `async`
     module::r#async(); // OK
 }
diff --git a/src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr b/src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr
index 46aa9ca34e1..93a7627f887 100644
--- a/src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr
+++ b/src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr
@@ -1,18 +1,18 @@
-error: expected identifier, found reserved keyword `async`
+error: expected identifier, found keyword `async`
   --> $DIR/edition-keywords-2018-2018-parsing.rs:8:13
    |
 LL |     let mut async = 1;
-   |             ^^^^^ expected identifier, found reserved keyword
+   |             ^^^^^ expected identifier, found keyword
 help: you can escape reserved keywords to use them as identifiers
    |
 LL |     let mut r#async = 1;
    |             ^^^^^^^
 
-error: expected identifier, found reserved keyword `async`
+error: expected identifier, found keyword `async`
   --> $DIR/edition-keywords-2018-2018-parsing.rs:18:13
    |
 LL |     module::async();
-   |             ^^^^^ expected identifier, found reserved keyword
+   |             ^^^^^ expected identifier, found keyword
 help: you can escape reserved keywords to use them as identifiers
    |
 LL |     module::r#async();
diff --git a/src/test/ui/parser/mut-patterns.rs b/src/test/ui/parser/mut-patterns.rs
index d46186a0fea..66fd5893af5 100644
--- a/src/test/ui/parser/mut-patterns.rs
+++ b/src/test/ui/parser/mut-patterns.rs
@@ -28,7 +28,7 @@ pub fn main() {
     //~| ERROR `mut` must be attached to each individual binding
     //~| ERROR expected identifier, found reserved keyword `yield`
     //~| ERROR expected identifier, found reserved keyword `become`
-    //~| ERROR expected identifier, found reserved keyword `await`
+    //~| ERROR expected identifier, found keyword `await`
 
     struct W<T, U>(T, U);
     struct B { f: Box<u8> }
diff --git a/src/test/ui/parser/mut-patterns.stderr b/src/test/ui/parser/mut-patterns.stderr
index 18ffaa52558..b1cf99189f1 100644
--- a/src/test/ui/parser/mut-patterns.stderr
+++ b/src/test/ui/parser/mut-patterns.stderr
@@ -62,11 +62,11 @@ help: you can escape reserved keywords to use them as identifiers
 LL |     let mut mut yield(r#become, await) = r#yield(0, 0);
    |                       ^^^^^^^^
 
-error: expected identifier, found reserved keyword `await`
+error: expected identifier, found keyword `await`
   --> $DIR/mut-patterns.rs:26:31
    |
 LL |     let mut mut yield(become, await) = r#yield(0, 0);
-   |                               ^^^^^ expected identifier, found reserved keyword
+   |                               ^^^^^ expected identifier, found keyword
 help: you can escape reserved keywords to use them as identifiers
    |
 LL |     let mut mut yield(become, r#await) = r#yield(0, 0);