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 {
1754
1754
use rustc_data_structures:: OnDrop ;
1755
1755
use rayon_core;
1756
1756
use dep_graph:: OpenTask ;
1757
- use rustc_data_structures:: sync:: { Lrc , Lock } ;
1757
+ use rustc_data_structures:: sync:: { self , Lrc , Lock } ;
1758
1758
1759
1759
/// This is the implicit state of rustc. It contains the current
1760
1760
/// TyCtxt and query. It is updated when creating a local interner or
@@ -1924,6 +1924,10 @@ pub mod tls {
1924
1924
if context == 0 {
1925
1925
f ( None )
1926
1926
} else {
1927
+ // We could get a ImplicitCtxt pointer from another thread.
1928
+ // Ensure that ImplicitCtxt is Sync
1929
+ sync:: assert_sync :: < ImplicitCtxt > ( ) ;
1930
+
1927
1931
unsafe { f ( Some ( & * ( context as * const ImplicitCtxt ) ) ) }
1928
1932
}
1929
1933
}
You can’t perform that action at this time.
0 commit comments