We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9eb4f73 commit 85acb1dCopy full SHA for 85acb1d
src/librustc/ty/context.rs
@@ -1704,7 +1704,7 @@ pub mod tls {
1704
use ty::maps;
1705
use errors::{Diagnostic, TRACK_DIAGNOSTICS};
1706
use rustc_data_structures::OnDrop;
1707
- use rustc_data_structures::sync::Lrc;
+ use rustc_data_structures::sync::{self, Lrc};
1708
use dep_graph::OpenTask;
1709
1710
/// This is the implicit state of rustc. It contains the current
@@ -1832,6 +1832,10 @@ pub mod tls {
1832
if context == 0 {
1833
f(None)
1834
} else {
1835
+ // We could get a ImplicitCtxt pointer from another thread.
1836
+ // Ensure that ImplicitCtxt is Sync
1837
+ sync::assert_sync::<ImplicitCtxt>();
1838
+
1839
unsafe { f(Some(&*(context as *const ImplicitCtxt))) }
1840
}
1841
0 commit comments