Store boxed metadata loader in CrateLoader

This commit is contained in:
bjorn3 2021-05-31 17:36:53 +02:00
parent ecc68e7879
commit db4d8e2cab
3 changed files with 6 additions and 6 deletions

View File

@ -218,7 +218,7 @@ pub fn configure_and_expand(
krate,
&crate_name,
&resolver_arenas,
&*metadata_loader,
metadata_loader,
);
let mut resolver = match res {
Err(v) => {
@ -350,7 +350,7 @@ fn configure_and_expand_inner<'a>(
mut krate: ast::Crate,
crate_name: &str,
resolver_arenas: &'a ResolverArenas<'a>,
metadata_loader: &'a MetadataLoaderDyn,
metadata_loader: Box<MetadataLoaderDyn>,
) -> Result<(ast::Crate, Resolver<'a>)> {
tracing::trace!("configure_and_expand_inner");
pre_expansion_lint(sess, lint_store, &krate, crate_name);

View File

@ -54,7 +54,7 @@ pub struct CStore {
pub struct CrateLoader<'a> {
// Immutable configuration.
sess: &'a Session,
metadata_loader: &'a MetadataLoaderDyn,
metadata_loader: Box<MetadataLoaderDyn>,
local_crate_name: Symbol,
// Mutable output.
cstore: CStore,
@ -219,7 +219,7 @@ impl CStore {
impl<'a> CrateLoader<'a> {
pub fn new(
sess: &'a Session,
metadata_loader: &'a MetadataLoaderDyn,
metadata_loader: Box<MetadataLoaderDyn>,
local_crate_name: &str,
) -> Self {
let local_crate_stable_id =
@ -544,7 +544,7 @@ impl<'a> CrateLoader<'a> {
info!("falling back to a load");
let mut locator = CrateLocator::new(
self.sess,
self.metadata_loader,
&*self.metadata_loader,
name,
hash,
host_hash,

View File

@ -1198,7 +1198,7 @@ impl<'a> Resolver<'a> {
session: &'a Session,
krate: &Crate,
crate_name: &str,
metadata_loader: &'a MetadataLoaderDyn,
metadata_loader: Box<MetadataLoaderDyn>,
arenas: &'a ResolverArenas<'a>,
) -> Resolver<'a> {
let root_local_def_id = LocalDefId { local_def_index: CRATE_DEF_INDEX };