about summary refs log tree commit diff
path: root/compiler/rustc_interface/src
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-08-13 16:35:09 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-08-13 16:38:50 +0000
commitc6247387b4f3795df71866178fab5af1f2253dd6 (patch)
tree909c7531d34eddbd8731b80ca13b2a77bcc035ff /compiler/rustc_interface/src
parent980143b50c627fc36ef15a2dc25f44f33cbd6bac (diff)
downloadrust-c6247387b4f3795df71866178fab5af1f2253dd6.tar.gz
rust-c6247387b4f3795df71866178fab5af1f2253dd6.zip
Remove metadata_loader query
It is only used by CrateLoader. We can store the metadata loader in
CStore instead which CrateLoader has access to.
Diffstat (limited to 'compiler/rustc_interface/src')
-rw-r--r--compiler/rustc_interface/src/queries.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_interface/src/queries.rs b/compiler/rustc_interface/src/queries.rs
index a20a99b611e..6b4a451cd7b 100644
--- a/compiler/rustc_interface/src/queries.rs
+++ b/compiler/rustc_interface/src/queries.rs
@@ -193,7 +193,10 @@ impl<'tcx> Queries<'tcx> {
                 self.compiler.register_lints.as_deref(),
                 &pre_configured_attrs,
             ));
-            let cstore = RwLock::new(Box::new(CStore::new(stable_crate_id)) as _);
+            let cstore = RwLock::new(Box::new(CStore::new(
+                self.codegen_backend().metadata_loader(),
+                stable_crate_id,
+            )) as _);
             let definitions = RwLock::new(Definitions::new(stable_crate_id));
             let source_span = AppendOnlyIndexVec::new();
             let _id = source_span.push(krate.spans.inner_span);
@@ -221,9 +224,6 @@ impl<'tcx> Queries<'tcx> {
                     tcx.arena.alloc(rustc_expand::config::features(sess, &pre_configured_attrs)),
                 );
                 feed.crate_for_resolver(tcx.arena.alloc(Steal::new((krate, pre_configured_attrs))));
-                feed.metadata_loader(
-                    tcx.arena.alloc(Steal::new(self.codegen_backend().metadata_loader())),
-                );
             });
             Ok(qcx)
         })