Rename take_trait_map.

This commit is contained in:
Camille GILLOT 2021-05-29 23:10:04 +02:00
parent c11691b460
commit 0839cd5e9a
2 changed files with 3 additions and 3 deletions

View File

@ -198,7 +198,7 @@ pub trait ResolverAstLowering {
fn next_node_id(&mut self) -> NodeId;
fn trait_map(&mut self) -> NodeMap<Vec<hir::TraitCandidate>>;
fn take_trait_map(&mut self) -> NodeMap<Vec<hir::TraitCandidate>>;
fn opt_local_def_id(&self, node: NodeId) -> Option<LocalDefId>;
@ -502,7 +502,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
c.proc_macros.iter().map(|id| self.node_id_to_hir_id[*id].unwrap()).collect();
let mut trait_map: FxHashMap<_, FxHashMap<_, _>> = FxHashMap::default();
for (k, v) in self.resolver.trait_map().into_iter() {
for (k, v) in self.resolver.take_trait_map().into_iter() {
if let Some(Some(hir_id)) = self.node_id_to_hir_id.get(k) {
let map = trait_map.entry(hir_id.owner).or_default();
map.insert(hir_id.local_id, v.into_boxed_slice());

View File

@ -1140,7 +1140,7 @@ impl ResolverAstLowering for Resolver<'_> {
self.next_node_id()
}
fn trait_map(&mut self) -> NodeMap<Vec<TraitCandidate>> {
fn take_trait_map(&mut self) -> NodeMap<Vec<TraitCandidate>> {
#[cfg(debug_assertions)]
{
debug_assert!(!self.took_trait_map);