about summary refs log tree commit diff
path: root/src/libsyntax_pos
diff options
context:
space:
mode:
authorJoshua Barretto <barry.of.smith@gmail.com>2018-04-05 20:59:32 +0100
committerGitHub <noreply@github.com>2018-04-05 20:59:32 +0100
commit5e94d5498d3a24418185a1783f2819cbb2280ddd (patch)
treead100bc79003d246837e5fc080b23f675d8c17c6 /src/libsyntax_pos
parent446285e45c02f71392c7084328dc167d2e1ff58c (diff)
parent7222241e7c2d7caf9ad6ee6e34748e4addfb8dd3 (diff)
downloadrust-5e94d5498d3a24418185a1783f2819cbb2280ddd.tar.gz
rust-5e94d5498d3a24418185a1783f2819cbb2280ddd.zip
Merge pull request #1 from rust-lang/master
Merge upstream changes
Diffstat (limited to 'src/libsyntax_pos')
-rw-r--r--src/libsyntax_pos/hygiene.rs2
-rw-r--r--src/libsyntax_pos/lib.rs8
-rw-r--r--src/libsyntax_pos/symbol.rs6
3 files changed, 11 insertions, 5 deletions
diff --git a/src/libsyntax_pos/hygiene.rs b/src/libsyntax_pos/hygiene.rs
index 85a2940ec44..aba71bd0468 100644
--- a/src/libsyntax_pos/hygiene.rs
+++ b/src/libsyntax_pos/hygiene.rs
@@ -430,7 +430,6 @@ pub enum ExpnFormat {
 /// The kind of compiler desugaring.
 #[derive(Clone, Hash, Debug, PartialEq, Eq, RustcEncodable, RustcDecodable)]
 pub enum CompilerDesugaringKind {
-    BackArrow,
     DotFill,
     QuestionMark,
 }
@@ -439,7 +438,6 @@ impl CompilerDesugaringKind {
     pub fn as_symbol(&self) -> Symbol {
         use CompilerDesugaringKind::*;
         let s = match *self {
-            BackArrow => "<-",
             DotFill => "...",
             QuestionMark => "?",
         };
diff --git a/src/libsyntax_pos/lib.rs b/src/libsyntax_pos/lib.rs
index 9b83d5510fb..eb345200f41 100644
--- a/src/libsyntax_pos/lib.rs
+++ b/src/libsyntax_pos/lib.rs
@@ -21,7 +21,7 @@
 
 #![feature(const_fn)]
 #![feature(custom_attribute)]
-#![feature(i128_type)]
+#![cfg_attr(stage0, feature(i128_type))]
 #![feature(optin_builtin_traits)]
 #![allow(unused_attributes)]
 #![feature(specialization)]
@@ -184,8 +184,12 @@ impl SpanData {
     }
 }
 
-// The interner in thread-local, so `Span` shouldn't move between threads.
+// The interner is pointed to by a thread local value which is only set on the main thread
+// with parallelization is disabled. So we don't allow Span to transfer between threads
+// to avoid panics and other errors, even though it would be memory safe to do so.
+#[cfg(not(parallel_queries))]
 impl !Send for Span {}
+#[cfg(not(parallel_queries))]
 impl !Sync for Span {}
 
 impl PartialOrd for Span {
diff --git a/src/libsyntax_pos/symbol.rs b/src/libsyntax_pos/symbol.rs
index 7ab4ac9794d..ce269e69b8b 100644
--- a/src/libsyntax_pos/symbol.rs
+++ b/src/libsyntax_pos/symbol.rs
@@ -83,8 +83,12 @@ impl Decodable for Ident {
 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
 pub struct Symbol(u32);
 
-// The interner in thread-local, so `Symbol` shouldn't move between threads.
+// The interner is pointed to by a thread local value which is only set on the main thread
+// with parallelization is disabled. So we don't allow Symbol to transfer between threads
+// to avoid panics and other errors, even though it would be memory safe to do so.
+#[cfg(not(parallel_queries))]
 impl !Send for Symbol { }
+#[cfg(not(parallel_queries))]
 impl !Sync for Symbol { }
 
 impl Symbol {