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;
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 {
};
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 {
compiler.output_file(),
).and_then(|| RustcDefaultCalls::list_metadata(
sess,
- compiler.cstore(),
+ &*compiler.codegen_backend().metadata_loader(),
&matches,
compiler.input()
));
impl RustcDefaultCalls {
pub fn list_metadata(sess: &Session,
- cstore: &CStore,
+ metadata_loader: &dyn MetadataLoader,
matches: &getopts::Matches,
input: &Input)
-> Compilation {
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());