1
Fork 0

Revert "Reduce the amount of untracked state in TyCtxt"

This commit is contained in:
Camille Gillot 2021-06-01 09:05:22 +02:00 committed by GitHub
parent c9c1f8be3f
commit 0f0f3138cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 255 additions and 234 deletions

View file

@ -910,8 +910,6 @@ pub struct Resolver<'a> {
extern_crate_map: FxHashMap<LocalDefId, CrateNum>,
export_map: ExportMap<LocalDefId>,
trait_map: NodeMap<Vec<TraitCandidate>>,
#[cfg(debug_assertions)]
took_trait_map: bool,
/// A map from nodes to anonymous modules.
/// Anonymous modules are pseudo-modules that are implicitly created around items
@ -1140,13 +1138,8 @@ impl ResolverAstLowering for Resolver<'_> {
self.next_node_id()
}
fn take_trait_map(&mut self) -> NodeMap<Vec<TraitCandidate>> {
#[cfg(debug_assertions)]
{
debug_assert!(!self.took_trait_map);
self.took_trait_map = true;
}
std::mem::take(&mut self.trait_map)
fn trait_map(&self) -> &NodeMap<Vec<TraitCandidate>> {
&self.trait_map
}
fn opt_local_def_id(&self, node: NodeId) -> Option<LocalDefId> {
@ -1294,8 +1287,6 @@ impl<'a> Resolver<'a> {
extern_crate_map: Default::default(),
export_map: FxHashMap::default(),
trait_map: Default::default(),
#[cfg(debug_assertions)]
took_trait_map: false,
underscore_disambiguator: 0,
empty_module,
module_map,