Rename take_trait_map.
This commit is contained in:
parent
8832cc20b7
commit
2b6daf9e14
2 changed files with 3 additions and 3 deletions
|
@ -198,7 +198,7 @@ pub trait ResolverAstLowering {
|
||||||
|
|
||||||
fn next_node_id(&mut self) -> NodeId;
|
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>;
|
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();
|
c.proc_macros.iter().map(|id| self.node_id_to_hir_id[*id].unwrap()).collect();
|
||||||
|
|
||||||
let mut trait_map: FxHashMap<_, FxHashMap<_, _>> = FxHashMap::default();
|
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) {
|
if let Some(Some(hir_id)) = self.node_id_to_hir_id.get(k) {
|
||||||
let map = trait_map.entry(hir_id.owner).or_default();
|
let map = trait_map.entry(hir_id.owner).or_default();
|
||||||
map.insert(hir_id.local_id, v.into_boxed_slice());
|
map.insert(hir_id.local_id, v.into_boxed_slice());
|
||||||
|
|
|
@ -1140,7 +1140,7 @@ impl ResolverAstLowering for Resolver<'_> {
|
||||||
self.next_node_id()
|
self.next_node_id()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn trait_map(&mut self) -> NodeMap<Vec<TraitCandidate>> {
|
fn take_trait_map(&mut self) -> NodeMap<Vec<TraitCandidate>> {
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
{
|
{
|
||||||
debug_assert!(!self.took_trait_map);
|
debug_assert!(!self.took_trait_map);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue