Move confused_type_with_std_module to ResolverOutputs

This eliminates untracked global state from `Session`.
This commit is contained in:
Aaron Hill 2021-09-06 11:20:59 -05:00
parent 1c858ba5bf
commit 404402430d
No known key found for this signature in database
GPG key ID: B4087E510E98B164
6 changed files with 12 additions and 11 deletions

View file

@ -1038,6 +1038,7 @@ pub struct Resolver<'a> {
/// A list of proc macro LocalDefIds, written out in the order in which
/// they are declared in the static array generated by proc_macro_harness.
proc_macros: Vec<NodeId>,
confused_type_with_std_module: FxHashMap<Span, Span>,
}
/// Nothing really interesting here; it just provides memory for the rest of the crate.
@ -1404,6 +1405,7 @@ impl<'a> Resolver<'a> {
main_def: Default::default(),
trait_impls: Default::default(),
proc_macros: Default::default(),
confused_type_with_std_module: Default::default(),
};
let root_parent_scope = ParentScope::module(graph_root, &resolver);
@ -1447,6 +1449,7 @@ impl<'a> Resolver<'a> {
let maybe_unused_extern_crates = self.maybe_unused_extern_crates;
let glob_map = self.glob_map;
let main_def = self.main_def;
let confused_type_with_std_module = self.confused_type_with_std_module;
ResolverOutputs {
definitions,
cstore: Box::new(self.crate_loader.into_cstore()),
@ -1464,6 +1467,7 @@ impl<'a> Resolver<'a> {
main_def,
trait_impls: self.trait_impls,
proc_macros,
confused_type_with_std_module,
}
}
@ -1486,6 +1490,7 @@ impl<'a> Resolver<'a> {
main_def: self.main_def.clone(),
trait_impls: self.trait_impls.clone(),
proc_macros,
confused_type_with_std_module: self.confused_type_with_std_module.clone(),
}
}