about summary refs log tree commit diff
path: root/compiler/rustc_interface/src
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-12-08 10:53:20 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2023-02-20 15:28:58 +0000
commitade3dceb38c6e41e3b8623e252d9413052e3a0af (patch)
tree8c3c14c9b87f01110fcabe47d1a9035bc3486526 /compiler/rustc_interface/src
parente8e227aec84ea8b19751d9dd851a10937a70810a (diff)
downloadrust-ade3dceb38c6e41e3b8623e252d9413052e3a0af.tar.gz
rust-ade3dceb38c6e41e3b8623e252d9413052e3a0af.zip
Make untracked.cstore lockable so that resolution can still write to it when using TyCtxt
Diffstat (limited to 'compiler/rustc_interface/src')
-rw-r--r--compiler/rustc_interface/src/passes.rs2
-rw-r--r--compiler/rustc_interface/src/queries.rs3
2 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs
index 6a94d19001e..43882e10303 100644
--- a/compiler/rustc_interface/src/passes.rs
+++ b/compiler/rustc_interface/src/passes.rs
@@ -597,7 +597,7 @@ fn output_filenames(tcx: TyCtxt<'_>, (): ()) -> Arc<OutputFilenames> {
         }
     }
 
-    write_out_deps(sess, tcx.cstore_untracked(), &outputs, &output_paths);
+    write_out_deps(sess, &*tcx.cstore_untracked(), &outputs, &output_paths);
 
     let only_dep_info = sess.opts.output_types.contains_key(&OutputType::DepInfo)
         && sess.opts.output_types.len() == 1;
diff --git a/compiler/rustc_interface/src/queries.rs b/compiler/rustc_interface/src/queries.rs
index d727efdafc2..bc7c78a3108 100644
--- a/compiler/rustc_interface/src/queries.rs
+++ b/compiler/rustc_interface/src/queries.rs
@@ -215,6 +215,9 @@ impl<'tcx> Queries<'tcx> {
                 ast_lowering: untracked_resolver_for_lowering,
             } = resolver_outputs;
 
+            // Make sure we don't mutate the cstore from here on.
+            std::mem::forget(untracked.cstore.read());
+
             let gcx = passes::create_global_ctxt(
                 self.compiler,
                 lint_store,