about summary refs log tree commit diff
path: root/compiler/rustc_session
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2023-01-31 23:38:53 +0100
committerGitHub <noreply@github.com>2023-01-31 23:38:53 +0100
commitfe44f3bdd082eb04a1e42212e613a7c84c018f00 (patch)
tree618f7838585584cc40d12f68ce3650d39a7e9d3f /compiler/rustc_session
parentf0e4a1c9cb7890576b22b740867608af43dac714 (diff)
parentef6b583a80495ccbfd378eb19ebec3d633036790 (diff)
downloadrust-fe44f3bdd082eb04a1e42212e613a7c84c018f00.tar.gz
rust-fe44f3bdd082eb04a1e42212e613a7c84c018f00.zip
Rollup merge of #107508 - WaffleLapkin:uneq'15, r=oli-obk
`Edition` micro refactor

r? ``@oli-obk``
Diffstat (limited to 'compiler/rustc_session')
-rw-r--r--compiler/rustc_session/src/session.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs
index 91d23f1041f..3b2cd1864c5 100644
--- a/compiler/rustc_session/src/session.rs
+++ b/compiler/rustc_session/src/session.rs
@@ -918,23 +918,24 @@ impl Session {
         ret
     }
 
+    /// Is this edition 2015?
     pub fn rust_2015(&self) -> bool {
-        self.edition() == Edition::Edition2015
+        self.edition().rust_2015()
     }
 
     /// Are we allowed to use features from the Rust 2018 edition?
     pub fn rust_2018(&self) -> bool {
-        self.edition() >= Edition::Edition2018
+        self.edition().rust_2018()
     }
 
     /// Are we allowed to use features from the Rust 2021 edition?
     pub fn rust_2021(&self) -> bool {
-        self.edition() >= Edition::Edition2021
+        self.edition().rust_2021()
     }
 
     /// Are we allowed to use features from the Rust 2024 edition?
     pub fn rust_2024(&self) -> bool {
-        self.edition() >= Edition::Edition2024
+        self.edition().rust_2024()
     }
 
     /// Returns `true` if we cannot skip the PLT for shared library calls.