about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2025-03-12 16:28:15 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2025-03-24 18:44:40 +1100
commita29e875b63542b1809ae6beb6fabbdacbb16971f (patch)
tree970c0a59077397e2a76ebb067ab87fc8d822c08b
parent10236fbe7bea988dd94509e437c63b855fd1ec00 (diff)
downloadrust-a29e875b63542b1809ae6beb6fabbdacbb16971f.tar.gz
rust-a29e875b63542b1809ae6beb6fabbdacbb16971f.zip
Move `is_used_keyword_conditional`.
So the order of the `Symbol::is_*` predicates match the order of the
keywords list.
-rw-r--r--compiler/rustc_span/src/symbol.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs
index 33ffa00a369..3e474243965 100644
--- a/compiler/rustc_span/src/symbol.rs
+++ b/compiler/rustc_span/src/symbol.rs
@@ -2697,14 +2697,14 @@ impl Symbol {
         self >= kw::As && self <= kw::While
     }
 
-    fn is_used_keyword_conditional(self, edition: impl FnOnce() -> Edition) -> bool {
-        (self >= kw::Async && self <= kw::Dyn) && edition() >= Edition::Edition2018
-    }
-
     fn is_unused_keyword_always(self) -> bool {
         self >= kw::Abstract && self <= kw::Yield
     }
 
+    fn is_used_keyword_conditional(self, edition: impl FnOnce() -> Edition) -> bool {
+        (self >= kw::Async && self <= kw::Dyn) && edition() >= Edition::Edition2018
+    }
+
     fn is_unused_keyword_conditional(self, edition: impl Copy + FnOnce() -> Edition) -> bool {
         self == kw::Gen && edition().at_least_rust_2024()
             || self == kw::Try && edition().at_least_rust_2018()