]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax_pos/edition.rs
Remove unchecked inline attribute, remove unused functions, make chache mod private...
[rust.git] / src / libsyntax_pos / edition.rs
index 20216568426fed72d2938c8d0fdcbee129df52e7..727aad546f5f12d4661a730b440916534afd9367 100644 (file)
@@ -1,10 +1,12 @@
 use crate::symbol::{Symbol, sym};
 use std::fmt;
 use std::str::FromStr;
-use crate::GLOBALS;
+
+use rustc_macros::HashStable_Generic;
 
 /// The edition of the compiler (RFC 2052)
-#[derive(Clone, Copy, Hash, PartialEq, PartialOrd, Debug, RustcEncodable, RustcDecodable, Eq)]
+#[derive(Clone, Copy, Hash, PartialEq, PartialOrd, Debug,
+         RustcEncodable, RustcDecodable, Eq, HashStable_Generic)]
 pub enum Edition {
     // editions must be kept in order, oldest to newest
 
@@ -39,10 +41,6 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
 }
 
 impl Edition {
-    pub fn from_session() -> Edition {
-        GLOBALS.with(|globals| globals.edition)
-    }
-
     pub fn lint_name(&self) -> &'static str {
         match *self {
             Edition::Edition2015 => "rust_2015_compatibility",