summary refs log tree commit diff
path: root/compiler/rustc_metadata/src/rmeta/decoder
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-05-31 13:47:36 +0000
committerbors <bors@rust-lang.org>2023-05-31 13:47:36 +0000
commitad8304a0d5280de30856b39c19df7b306957e878 (patch)
tree4c5167ddcf79cb528d67dcee35082adb7e38f980 /compiler/rustc_metadata/src/rmeta/decoder
parente4f7ad8e68206fa54372535b5c04d7ddbaea43be (diff)
parent52bd82f522c4f3d9bd0dc534c06169285afbc23b (diff)
downloadrust-ad8304a0d5280de30856b39c19df7b306957e878.tar.gz
rust-ad8304a0d5280de30856b39c19df7b306957e878.zip
Auto merge of #111076 - notriddle:notriddle/silence-private-dep-trait-impl-suggestions, r=cjgillot
diagnostics: exclude indirect private deps from trait impl suggest

Fixes #88696
Diffstat (limited to 'compiler/rustc_metadata/src/rmeta/decoder')
-rw-r--r--compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs
index 3d8991d99b5..a15307e4345 100644
--- a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs
+++ b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs
@@ -285,7 +285,13 @@ provide! { tcx, def_id, other, cdata,
     is_ctfe_mir_available => { cdata.is_ctfe_mir_available(def_id.index) }
 
     dylib_dependency_formats => { cdata.get_dylib_dependency_formats(tcx) }
-    is_private_dep => { cdata.private_dep }
+    is_private_dep => {
+        // Parallel compiler needs to synchronize type checking and linting (which use this flag)
+        // so that they happen strictly crate loading. Otherwise, the full list of available
+        // impls aren't loaded yet.
+        use std::sync::atomic::Ordering;
+        cdata.private_dep.load(Ordering::Acquire)
+    }
     is_panic_runtime => { cdata.root.panic_runtime }
     is_compiler_builtins => { cdata.root.compiler_builtins }
     has_global_allocator => { cdata.root.has_global_allocator }