File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -1754,7 +1754,7 @@ pub mod tls {
17541754 use rustc_data_structures:: OnDrop ;
17551755 use rayon_core;
17561756 use dep_graph:: OpenTask ;
1757- use rustc_data_structures:: sync:: { Lrc , Lock } ;
1757+ use rustc_data_structures:: sync:: { self , Lrc , Lock } ;
17581758
17591759 /// This is the implicit state of rustc. It contains the current
17601760 /// TyCtxt and query. It is updated when creating a local interner or
@@ -1924,6 +1924,10 @@ pub mod tls {
19241924 if context == 0 {
19251925 f ( None )
19261926 } else {
1927+ // We could get a ImplicitCtxt pointer from another thread.
1928+ // Ensure that ImplicitCtxt is Sync
1929+ sync:: assert_sync :: < ImplicitCtxt > ( ) ;
1930+
19271931 unsafe { f ( Some ( & * ( context as * const ImplicitCtxt ) ) ) }
19281932 }
19291933 }
You can’t perform that action at this time.
0 commit comments