File tree 3 files changed +9
-2
lines changed
compiler/rustc_interface/src
3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,9 @@ pub struct Compiler {
43
43
pub compiler_for_deadlock_handler : Arc < AtomicPtr < ( ) > > ,
44
44
}
45
45
46
+ impl !Sync for Compiler { }
47
+ impl !rustc_data_structures:: sync:: DynSync for Compiler { }
48
+
46
49
/// Converts strings provided as `--cfg [cfgspec]` into a `Cfg`.
47
50
pub ( crate ) fn parse_cfg ( dcx : & DiagCtxt , cfgs : Vec < String > ) -> Cfg {
48
51
cfgs. into_iter ( )
Original file line number Diff line number Diff line change 4
4
#![ feature( let_chains) ]
5
5
#![ feature( thread_spawn_unchecked) ]
6
6
#![ feature( try_blocks) ]
7
+ #![ feature( negative_impls) ]
7
8
8
9
#[ macro_use]
9
10
extern crate tracing;
Original file line number Diff line number Diff line change @@ -161,9 +161,11 @@ impl<'tcx> Queries<'tcx> {
161
161
& self . hir_arena ,
162
162
) ;
163
163
164
- self . compiler
164
+ let old = self
165
+ . compiler
165
166
. compiler_for_deadlock_handler
166
- . store ( qcx as * const _ as * mut _ , Ordering :: Relaxed ) ;
167
+ . swap ( qcx as * const _ as * mut _ , Ordering :: Relaxed ) ;
168
+ assert ! ( old. is_null( ) ) ;
167
169
168
170
qcx. enter ( |tcx| {
169
171
let feed = tcx. feed_local_crate ( ) ;
@@ -321,6 +323,7 @@ impl Compiler {
321
323
// is accessing the `GlobalCtxt`.
322
324
self . compiler_for_deadlock_handler . store ( std:: ptr:: null_mut ( ) , Ordering :: Relaxed ) ;
323
325
} ) ;
326
+ assert ! ( self . compiler_for_deadlock_handler. load( Ordering :: Relaxed ) . is_null( ) ) ;
324
327
let queries = Queries :: new ( self ) ;
325
328
let ret = f ( & queries) ;
326
329
You can’t perform that action at this time.
0 commit comments