Use HirId in ResolverOutputs::export_map instead of NodeId
This commit is contained in:
parent
3c5dba7c62
commit
52359f7c60
3 changed files with 27 additions and 14 deletions
|
|
@ -1131,17 +1131,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||
consts: common_consts,
|
||||
extern_crate_map: resolutions.extern_crate_map,
|
||||
trait_map,
|
||||
export_map: resolutions
|
||||
.export_map
|
||||
.into_iter()
|
||||
.map(|(k, v)| {
|
||||
let exports: Vec<_> = v
|
||||
.into_iter()
|
||||
.map(|e| e.map_id(|id| definitions.node_id_to_hir_id(id)))
|
||||
.collect();
|
||||
(k, exports)
|
||||
})
|
||||
.collect(),
|
||||
export_map: resolutions.export_map,
|
||||
maybe_unused_trait_imports: resolutions
|
||||
.maybe_unused_trait_imports
|
||||
.into_iter()
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ pub struct ResolverOutputs {
|
|||
pub trait_map: FxHashMap<hir::HirId, Vec<hir::TraitCandidate<hir::HirId>>>,
|
||||
pub maybe_unused_trait_imports: NodeSet,
|
||||
pub maybe_unused_extern_crates: Vec<(NodeId, Span)>,
|
||||
pub export_map: ExportMap<NodeId>,
|
||||
pub export_map: ExportMap<hir::HirId>,
|
||||
pub glob_map: GlobMap,
|
||||
/// Extern prelude entries. The value is `true` if the entry was introduced
|
||||
/// via `extern crate` item and not `--extern` option or compiler built-in.
|
||||
|
|
|
|||
|
|
@ -1274,6 +1274,18 @@ impl<'a> Resolver<'a> {
|
|||
|
||||
pub fn into_outputs(self) -> ResolverOutputs {
|
||||
let definitions = self.definitions;
|
||||
let export_map = {
|
||||
let mut map = FxHashMap::default();
|
||||
for (k, v) in self.export_map.into_iter() {
|
||||
map.insert(
|
||||
k,
|
||||
v.into_iter()
|
||||
.map(|e| e.map_id(|id| definitions.node_id_to_hir_id(id)))
|
||||
.collect(),
|
||||
);
|
||||
}
|
||||
map
|
||||
};
|
||||
let trait_map = {
|
||||
let mut map = FxHashMap::default();
|
||||
for (k, v) in self.trait_map.into_iter() {
|
||||
|
|
@ -1290,7 +1302,7 @@ impl<'a> Resolver<'a> {
|
|||
definitions: definitions,
|
||||
cstore: Box::new(self.crate_loader.into_cstore()),
|
||||
extern_crate_map: self.extern_crate_map,
|
||||
export_map: self.export_map,
|
||||
export_map,
|
||||
trait_map,
|
||||
glob_map: self.glob_map,
|
||||
maybe_unused_trait_imports: self.maybe_unused_trait_imports,
|
||||
|
|
@ -1308,7 +1320,18 @@ impl<'a> Resolver<'a> {
|
|||
definitions: self.definitions.clone(),
|
||||
cstore: Box::new(self.cstore().clone()),
|
||||
extern_crate_map: self.extern_crate_map.clone(),
|
||||
export_map: self.export_map.clone(),
|
||||
export_map: {
|
||||
let mut map = FxHashMap::default();
|
||||
for (k, v) in self.export_map.iter() {
|
||||
map.insert(
|
||||
k.clone(),
|
||||
v.iter()
|
||||
.map(|e| e.clone().map_id(|id| self.definitions.node_id_to_hir_id(id)))
|
||||
.collect(),
|
||||
);
|
||||
}
|
||||
map
|
||||
},
|
||||
trait_map: {
|
||||
let mut map = FxHashMap::default();
|
||||
for (k, v) in self.trait_map.iter() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue