about summary refs log tree commit diff
path: root/src/libsyntax_pos/lib.rs
diff options
context:
space:
mode:
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2017-12-03 14:37:23 +0100
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2018-03-17 23:01:46 +0100
commit3fa69c935d2dc28207908987a3a3cb518ab7f62d (patch)
tree7a2132900024e2fb9f7939ca57421672152f95b5 /src/libsyntax_pos/lib.rs
parentf53d4af223a5301daa6123c7b1e4cba108700db4 (diff)
downloadrust-3fa69c935d2dc28207908987a3a3cb518ab7f62d.tar.gz
rust-3fa69c935d2dc28207908987a3a3cb518ab7f62d.zip
Make Span and Symbol implement Send and Sync
Diffstat (limited to 'src/libsyntax_pos/lib.rs')
-rw-r--r--src/libsyntax_pos/lib.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libsyntax_pos/lib.rs b/src/libsyntax_pos/lib.rs
index bec46ff3d79..51da9a755ec 100644
--- a/src/libsyntax_pos/lib.rs
+++ b/src/libsyntax_pos/lib.rs
@@ -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 {