about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2018-04-20 12:47:19 +0200
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2018-06-01 14:57:08 +0200
commitc6dbb14097c46d1438058ffd9d7838cb906f19fb (patch)
tree3a25851659c0eab8c29bdf4e14516c205576b864
parentd402d2d0d4c0f8cbccf52c119666b143adcc35b3 (diff)
downloadrust-c6dbb14097c46d1438058ffd9d7838cb906f19fb.tar.gz
rust-c6dbb14097c46d1438058ffd9d7838cb906f19fb.zip
Assert that GlobalCtxt is Sync
-rw-r--r--src/librustc/ty/context.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs
index 27cc9514e65..35b2ce50da7 100644
--- a/src/librustc/ty/context.rs
+++ b/src/librustc/ty/context.rs
@@ -58,7 +58,7 @@ use rustc_data_structures::stable_hasher::{HashStable, hash_stable_hashmap,
                                            StableVec};
 use arena::{TypedArena, SyncDroplessArena};
 use rustc_data_structures::indexed_vec::IndexVec;
-use rustc_data_structures::sync::{Lrc, Lock, WorkerLocal};
+use rustc_data_structures::sync::{self, Lrc, Lock, WorkerLocal};
 use std::any::Any;
 use std::borrow::Borrow;
 use std::cmp::Ordering;
@@ -1179,6 +1179,8 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
             output_filenames: Arc::new(output_filenames.clone()),
         };
 
+        sync::assert_send_val(&gcx);
+
         tls::enter_global(gcx, f)
     }