]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax_pos/symbol.rs
async/await: improve obligation errors
[rust.git] / src / libsyntax_pos / symbol.rs
index 597ae83572cee8d924ee35294f50b421482c13b4..44a34070deccd9ac39fb760e5a6f2b30b3cd7531 100644 (file)
         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
         rustc_std_internal_symbol,
         rustc_symbol_name,
         rustc_synthetic,
+        rustc_reservation_impl,
         rustc_test_marker,
         rustc_then_this_would_need,
         rustc_variance,
@@ -1087,11 +1088,11 @@ pub fn integer<N: TryInto<usize> + Copy + ToString>(n: N) -> Symbol {
 
 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.