Use LocalDefId in ResolverOutputs::maybe_unused_trait_imports instead of NodeId
This commit is contained in:
parent
52359f7c60
commit
13c86f289b
3 changed files with 15 additions and 9 deletions
|
|
@ -1132,11 +1132,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||
extern_crate_map: resolutions.extern_crate_map,
|
||||
trait_map,
|
||||
export_map: resolutions.export_map,
|
||||
maybe_unused_trait_imports: resolutions
|
||||
.maybe_unused_trait_imports
|
||||
.into_iter()
|
||||
.map(|id| definitions.local_def_id(id))
|
||||
.collect(),
|
||||
maybe_unused_trait_imports: resolutions.maybe_unused_trait_imports,
|
||||
maybe_unused_extern_crates: resolutions
|
||||
.maybe_unused_extern_crates
|
||||
.into_iter()
|
||||
|
|
|
|||
|
|
@ -17,11 +17,12 @@ use crate::ty;
|
|||
use crate::ty::subst::{InternalSubsts, Subst, SubstsRef};
|
||||
use crate::ty::util::{Discr, IntTypeExt};
|
||||
use rustc_ast::ast;
|
||||
use rustc_ast::node_id::{NodeId, NodeMap, NodeSet};
|
||||
use rustc_ast::node_id::{NodeId, NodeMap};
|
||||
use rustc_attr as attr;
|
||||
use rustc_data_structures::captures::Captures;
|
||||
use rustc_data_structures::fingerprint::Fingerprint;
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_data_structures::fx::FxHashSet;
|
||||
use rustc_data_structures::fx::FxIndexMap;
|
||||
use rustc_data_structures::sorted_map::SortedIndexMultiMap;
|
||||
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
|
||||
|
|
@ -122,7 +123,7 @@ pub struct ResolverOutputs {
|
|||
pub cstore: Box<CrateStoreDyn>,
|
||||
pub extern_crate_map: NodeMap<CrateNum>,
|
||||
pub trait_map: FxHashMap<hir::HirId, Vec<hir::TraitCandidate<hir::HirId>>>,
|
||||
pub maybe_unused_trait_imports: NodeSet,
|
||||
pub maybe_unused_trait_imports: FxHashSet<LocalDefId>,
|
||||
pub maybe_unused_extern_crates: Vec<(NodeId, Span)>,
|
||||
pub export_map: ExportMap<hir::HirId>,
|
||||
pub glob_map: GlobMap,
|
||||
|
|
|
|||
|
|
@ -1298,6 +1298,11 @@ impl<'a> Resolver<'a> {
|
|||
}
|
||||
map
|
||||
};
|
||||
let maybe_unused_trait_imports = self
|
||||
.maybe_unused_trait_imports
|
||||
.into_iter()
|
||||
.map(|id| definitions.local_def_id(id))
|
||||
.collect();
|
||||
ResolverOutputs {
|
||||
definitions: definitions,
|
||||
cstore: Box::new(self.crate_loader.into_cstore()),
|
||||
|
|
@ -1305,7 +1310,7 @@ impl<'a> Resolver<'a> {
|
|||
export_map,
|
||||
trait_map,
|
||||
glob_map: self.glob_map,
|
||||
maybe_unused_trait_imports: self.maybe_unused_trait_imports,
|
||||
maybe_unused_trait_imports,
|
||||
maybe_unused_extern_crates: self.maybe_unused_extern_crates,
|
||||
extern_prelude: self
|
||||
.extern_prelude
|
||||
|
|
@ -1348,7 +1353,11 @@ impl<'a> Resolver<'a> {
|
|||
map
|
||||
},
|
||||
glob_map: self.glob_map.clone(),
|
||||
maybe_unused_trait_imports: self.maybe_unused_trait_imports.clone(),
|
||||
maybe_unused_trait_imports: self
|
||||
.maybe_unused_trait_imports
|
||||
.iter()
|
||||
.map(|id| self.definitions.local_def_id(id.clone()))
|
||||
.collect(),
|
||||
maybe_unused_extern_crates: self.maybe_unused_extern_crates.clone(),
|
||||
extern_prelude: self
|
||||
.extern_prelude
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue