Use DefId in ResolverOutputs::maybe_unused_extern_crates instead of NodeId
This commit is contained in:
parent
13c86f289b
commit
25f575b29f
3 changed files with 14 additions and 9 deletions
|
|
@ -1133,11 +1133,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||
trait_map,
|
||||
export_map: resolutions.export_map,
|
||||
maybe_unused_trait_imports: resolutions.maybe_unused_trait_imports,
|
||||
maybe_unused_extern_crates: resolutions
|
||||
.maybe_unused_extern_crates
|
||||
.into_iter()
|
||||
.map(|(id, sp)| (definitions.local_def_id(id).to_def_id(), sp))
|
||||
.collect(),
|
||||
maybe_unused_extern_crates: resolutions.maybe_unused_extern_crates,
|
||||
glob_map: resolutions
|
||||
.glob_map
|
||||
.into_iter()
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ 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};
|
||||
use rustc_ast::node_id::NodeMap;
|
||||
use rustc_attr as attr;
|
||||
use rustc_data_structures::captures::Captures;
|
||||
use rustc_data_structures::fingerprint::Fingerprint;
|
||||
|
|
@ -124,7 +124,7 @@ pub struct ResolverOutputs {
|
|||
pub extern_crate_map: NodeMap<CrateNum>,
|
||||
pub trait_map: FxHashMap<hir::HirId, Vec<hir::TraitCandidate<hir::HirId>>>,
|
||||
pub maybe_unused_trait_imports: FxHashSet<LocalDefId>,
|
||||
pub maybe_unused_extern_crates: Vec<(NodeId, Span)>,
|
||||
pub maybe_unused_extern_crates: Vec<(DefId, Span)>,
|
||||
pub export_map: ExportMap<hir::HirId>,
|
||||
pub glob_map: GlobMap,
|
||||
/// Extern prelude entries. The value is `true` if the entry was introduced
|
||||
|
|
|
|||
|
|
@ -1303,6 +1303,11 @@ impl<'a> Resolver<'a> {
|
|||
.into_iter()
|
||||
.map(|id| definitions.local_def_id(id))
|
||||
.collect();
|
||||
let maybe_unused_extern_crates = self
|
||||
.maybe_unused_extern_crates
|
||||
.into_iter()
|
||||
.map(|(id, sp)| (definitions.local_def_id(id).to_def_id(), sp))
|
||||
.collect();
|
||||
ResolverOutputs {
|
||||
definitions: definitions,
|
||||
cstore: Box::new(self.crate_loader.into_cstore()),
|
||||
|
|
@ -1311,7 +1316,7 @@ impl<'a> Resolver<'a> {
|
|||
trait_map,
|
||||
glob_map: self.glob_map,
|
||||
maybe_unused_trait_imports,
|
||||
maybe_unused_extern_crates: self.maybe_unused_extern_crates,
|
||||
maybe_unused_extern_crates,
|
||||
extern_prelude: self
|
||||
.extern_prelude
|
||||
.iter()
|
||||
|
|
@ -1358,7 +1363,11 @@ impl<'a> Resolver<'a> {
|
|||
.iter()
|
||||
.map(|id| self.definitions.local_def_id(id.clone()))
|
||||
.collect(),
|
||||
maybe_unused_extern_crates: self.maybe_unused_extern_crates.clone(),
|
||||
maybe_unused_extern_crates: self
|
||||
.maybe_unused_extern_crates
|
||||
.iter()
|
||||
.map(|(id, sp)| (self.definitions.local_def_id(id.clone()).to_def_id(), sp.clone()))
|
||||
.collect(),
|
||||
extern_prelude: self
|
||||
.extern_prelude
|
||||
.iter()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue