File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed
compiler/rustc_interface/src Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,9 @@ pub struct Compiler {
4343 pub compiler_for_deadlock_handler : Arc < AtomicPtr < ( ) > > ,
4444}
4545
46+ impl !Sync for Compiler { }
47+ impl !rustc_data_structures:: sync:: DynSync for Compiler { }
48+
4649/// Converts strings provided as `--cfg [cfgspec]` into a `Cfg`.
4750pub ( crate ) fn parse_cfg ( dcx : & DiagCtxt , cfgs : Vec < String > ) -> Cfg {
4851 cfgs. into_iter ( )
Original file line number Diff line number Diff line change 44#![ feature( let_chains) ]
55#![ feature( thread_spawn_unchecked) ]
66#![ feature( try_blocks) ]
7+ #![ feature( negative_impls) ]
78
89#[ macro_use]
910extern crate tracing;
Original file line number Diff line number Diff line change @@ -161,9 +161,11 @@ impl<'tcx> Queries<'tcx> {
161161 & self . hir_arena ,
162162 ) ;
163163
164- self . compiler
164+ let old = self
165+ . compiler
165166 . 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( ) ) ;
167169
168170 qcx. enter ( |tcx| {
169171 let feed = tcx. feed_local_crate ( ) ;
@@ -321,6 +323,7 @@ impl Compiler {
321323 // is accessing the `GlobalCtxt`.
322324 self . compiler_for_deadlock_handler . store ( std:: ptr:: null_mut ( ) , Ordering :: Relaxed ) ;
323325 } ) ;
326+ assert ! ( self . compiler_for_deadlock_handler. load( Ordering :: Relaxed ) . is_null( ) ) ;
324327 let queries = Queries :: new ( self ) ;
325328 let ret = f ( & queries) ;
326329
You can’t perform that action at this time.
0 commit comments