Skip to content

Commit 2c16f84

Browse files
committed
rustc_driver: Remove unnecessary use of crate store
1 parent 8e0007f commit 2c16f84

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/librustc_driver/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ use rustc::session::config::nightly_options;
3636
use rustc::session::{early_error, early_warn};
3737
use rustc::lint::Lint;
3838
use rustc::lint;
39+
use rustc::middle::cstore::MetadataLoader;
3940
use rustc::hir::def_id::LOCAL_CRATE;
4041
use rustc::ty::TyCtxt;
4142
use rustc::util::common::{set_time_depth, time, print_time_passes_entry, ErrorReported};
4243
use rustc_metadata::locator;
43-
use rustc_metadata::cstore::CStore;
4444
use rustc_codegen_utils::codegen_backend::CodegenBackend;
4545
use rustc_interface::interface;
4646
use rustc_interface::util::get_codegen_sysroot;
@@ -277,7 +277,7 @@ pub fn run_compiler(
277277
compiler.output_file(),
278278
).and_then(|| RustcDefaultCalls::list_metadata(
279279
sess,
280-
compiler.cstore(),
280+
&*compiler.codegen_backend().metadata_loader(),
281281
&matches,
282282
compiler.input()
283283
));
@@ -614,7 +614,7 @@ fn show_content_with_pager(content: &String) {
614614

615615
impl RustcDefaultCalls {
616616
pub fn list_metadata(sess: &Session,
617-
cstore: &CStore,
617+
metadata_loader: &dyn MetadataLoader,
618618
matches: &getopts::Matches,
619619
input: &Input)
620620
-> Compilation {
@@ -626,7 +626,7 @@ impl RustcDefaultCalls {
626626
let mut v = Vec::new();
627627
locator::list_file_metadata(&sess.target.target,
628628
path,
629-
cstore,
629+
metadata_loader,
630630
&mut v)
631631
.unwrap();
632632
println!("{}", String::from_utf8(v).unwrap());

src/librustc_metadata/locator.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212
//! no means all of the necessary details. Take a look at the rest of
213213
//! metadata::locator or metadata::creader for all the juicy details!
214214
215-
use crate::cstore::{MetadataBlob, CStore};
215+
use crate::cstore::MetadataBlob;
216216
use crate::creader::Library;
217217
use crate::schema::{METADATA_HEADER, rustc_version};
218218

@@ -914,7 +914,7 @@ fn get_metadata_section_imp(target: &Target,
914914
/// A diagnostic function for dumping crate metadata to an output stream.
915915
pub fn list_file_metadata(target: &Target,
916916
path: &Path,
917-
cstore: &CStore,
917+
metadata_loader: &dyn MetadataLoader,
918918
out: &mut dyn io::Write)
919919
-> io::Result<()> {
920920
let filename = path.file_name().unwrap().to_str().unwrap();
@@ -925,7 +925,7 @@ pub fn list_file_metadata(target: &Target,
925925
} else {
926926
CrateFlavor::Dylib
927927
};
928-
match get_metadata_section(target, flavor, path, &*cstore.metadata_loader) {
928+
match get_metadata_section(target, flavor, path, metadata_loader) {
929929
Ok(metadata) => metadata.list_crate_metadata(out),
930930
Err(msg) => write!(out, "{}\n", msg),
931931
}

0 commit comments

Comments
 (0)