about summary refs log tree commit diff
path: root/src/libsyntax_pos
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-08-13 22:48:27 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-08-15 20:41:45 +0300
commit74190a5e1c7439b001296fbc41da67682fd1d9bf (patch)
treeb1d989461ef6f3b70ebdabb1f1a53bdffeebff2f /src/libsyntax_pos
parent1a447738b8a7ac8f0a47a134f9fa1a60a4621620 (diff)
downloadrust-74190a5e1c7439b001296fbc41da67682fd1d9bf.tar.gz
rust-74190a5e1c7439b001296fbc41da67682fd1d9bf.zip
syntax_pos: Remove the duplicate global edition
It was introduced to avoid going through `hygiene_data`, but now it's read only once, when `ParseSess` is created, so going through a lock is ok.
Diffstat (limited to 'src/libsyntax_pos')
-rw-r--r--src/libsyntax_pos/edition.rs5
-rw-r--r--src/libsyntax_pos/lib.rs2
2 files changed, 0 insertions, 7 deletions
diff --git a/src/libsyntax_pos/edition.rs b/src/libsyntax_pos/edition.rs
index 20216568426..00cd00f2837 100644
--- a/src/libsyntax_pos/edition.rs
+++ b/src/libsyntax_pos/edition.rs
@@ -1,7 +1,6 @@
 use crate::symbol::{Symbol, sym};
 use std::fmt;
 use std::str::FromStr;
-use crate::GLOBALS;
 
 /// The edition of the compiler (RFC 2052)
 #[derive(Clone, Copy, Hash, PartialEq, PartialOrd, Debug, RustcEncodable, RustcDecodable, Eq)]
@@ -39,10 +38,6 @@ impl fmt::Display for Edition {
 }
 
 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",
diff --git a/src/libsyntax_pos/lib.rs b/src/libsyntax_pos/lib.rs
index 7af426eaa13..ae538677a3a 100644
--- a/src/libsyntax_pos/lib.rs
+++ b/src/libsyntax_pos/lib.rs
@@ -49,7 +49,6 @@ pub struct Globals {
     symbol_interner: Lock<symbol::Interner>,
     span_interner: Lock<span_encoding::SpanInterner>,
     hygiene_data: Lock<hygiene::HygieneData>,
-    edition: Edition,
 }
 
 impl Globals {
@@ -58,7 +57,6 @@ impl Globals {
             symbol_interner: Lock::new(symbol::Interner::fresh()),
             span_interner: Lock::new(span_encoding::SpanInterner::default()),
             hygiene_data: Lock::new(hygiene::HygieneData::new(edition)),
-            edition,
         }
     }
 }