X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_driver%2Flib.rs;h=6e8bc11162f66b351571e30fb08f606dd3c9aa4a;hb=83260d5c4370679f145d5cebb471f91e81771ee2;hp=a18ef014b4dc02d07732ff150d146765f3357d58;hpb=4e8d1b229217c7c83ce96b44410ccae9470db973;p=rust.git diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index a18ef014b4d..6e8bc11162f 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -36,11 +36,11 @@ use rustc::session::{early_error, early_warn}; use rustc::lint::Lint; use rustc::lint; +use rustc::middle::cstore::MetadataLoader; use rustc::hir::def_id::LOCAL_CRATE; use rustc::ty::TyCtxt; use rustc::util::common::{set_time_depth, time, print_time_passes_entry, ErrorReported}; use rustc_metadata::locator; -use rustc_metadata::cstore::CStore; use rustc_codegen_utils::codegen_backend::CodegenBackend; use rustc_interface::interface; use rustc_interface::util::get_codegen_sysroot; @@ -106,8 +106,6 @@ pub fn abort_on_err(result: Result, sess: &Session) -> T { pub trait Callbacks { /// Called before creating the compiler instance fn config(&mut self, _config: &mut interface::Config) {} - /// Called early during compilation to allow other drivers to easily register lints. - fn extra_lints(&mut self, _ls: &mut lint::LintStore) {} /// Called after parsing. Return value instructs the compiler whether to /// continue the compilation afterwards (defaults to `Compilation::Continue`) fn after_parsing(&mut self, _compiler: &interface::Compiler) -> Compilation { @@ -169,7 +167,7 @@ pub fn run_compiler( }; let sopts = config::build_session_options(&matches); - let cfg = config::parse_cfgspecs(matches.opt_strs("cfg")); + let cfg = interface::parse_cfgspecs(matches.opt_strs("cfg")); let mut dummy_config = |sopts, cfg, diagnostic_output| { let mut config = interface::Config { @@ -277,7 +275,7 @@ pub fn run_compiler( compiler.output_file(), ).and_then(|| RustcDefaultCalls::list_metadata( sess, - compiler.cstore(), + &*compiler.codegen_backend().metadata_loader(), &matches, compiler.input() )); @@ -614,7 +612,7 @@ fn show_content_with_pager(content: &String) { impl RustcDefaultCalls { pub fn list_metadata(sess: &Session, - cstore: &CStore, + metadata_loader: &dyn MetadataLoader, matches: &getopts::Matches, input: &Input) -> Compilation { @@ -626,7 +624,7 @@ pub fn list_metadata(sess: &Session, let mut v = Vec::new(); locator::list_file_metadata(&sess.target.target, path, - cstore, + metadata_loader, &mut v) .unwrap(); println!("{}", String::from_utf8(v).unwrap());