Skip to content

Commit 21f65ae

Browse files
committed
Use DefId in ResolverOutputs::glob_map instead of NodeId
1 parent 25f575b commit 21f65ae

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

src/librustc_middle/ty/context.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,11 +1134,7 @@ impl<'tcx> TyCtxt<'tcx> {
11341134
export_map: resolutions.export_map,
11351135
maybe_unused_trait_imports: resolutions.maybe_unused_trait_imports,
11361136
maybe_unused_extern_crates: resolutions.maybe_unused_extern_crates,
1137-
glob_map: resolutions
1138-
.glob_map
1139-
.into_iter()
1140-
.map(|(id, names)| (definitions.local_def_id(id), names))
1141-
.collect(),
1137+
glob_map: resolutions.glob_map,
11421138
extern_prelude: resolutions.extern_prelude,
11431139
untracked_crate: krate,
11441140
definitions,

src/librustc_middle/ty/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use rustc_hir as hir;
3232
use rustc_hir::def::{CtorKind, CtorOf, DefKind, Namespace, Res};
3333
use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, LocalDefId, CRATE_DEF_INDEX};
3434
use rustc_hir::lang_items::{FnMutTraitLangItem, FnOnceTraitLangItem, FnTraitLangItem};
35-
use rustc_hir::{Constness, GlobMap, Node};
35+
use rustc_hir::{Constness, Node};
3636
use rustc_index::vec::{Idx, IndexVec};
3737
use rustc_macros::HashStable;
3838
use rustc_serialize::{self, Encodable, Encoder};
@@ -126,7 +126,7 @@ pub struct ResolverOutputs {
126126
pub maybe_unused_trait_imports: FxHashSet<LocalDefId>,
127127
pub maybe_unused_extern_crates: Vec<(DefId, Span)>,
128128
pub export_map: ExportMap<hir::HirId>,
129-
pub glob_map: GlobMap,
129+
pub glob_map: FxHashMap<LocalDefId, FxHashSet<Symbol>>,
130130
/// Extern prelude entries. The value is `true` if the entry was introduced
131131
/// via `extern crate` item and not `--extern` option or compiler built-in.
132132
pub extern_prelude: FxHashMap<Symbol, bool>,

src/librustc_resolve/lib.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,13 +1308,18 @@ impl<'a> Resolver<'a> {
13081308
.into_iter()
13091309
.map(|(id, sp)| (definitions.local_def_id(id).to_def_id(), sp))
13101310
.collect();
1311+
let glob_map = self
1312+
.glob_map
1313+
.into_iter()
1314+
.map(|(id, names)| (definitions.local_def_id(id), names))
1315+
.collect();
13111316
ResolverOutputs {
13121317
definitions: definitions,
13131318
cstore: Box::new(self.crate_loader.into_cstore()),
13141319
extern_crate_map: self.extern_crate_map,
13151320
export_map,
13161321
trait_map,
1317-
glob_map: self.glob_map,
1322+
glob_map,
13181323
maybe_unused_trait_imports,
13191324
maybe_unused_extern_crates,
13201325
extern_prelude: self
@@ -1357,7 +1362,11 @@ impl<'a> Resolver<'a> {
13571362
}
13581363
map
13591364
},
1360-
glob_map: self.glob_map.clone(),
1365+
glob_map: self
1366+
.glob_map
1367+
.iter()
1368+
.map(|(id, names)| (self.definitions.local_def_id(id.clone()), names.clone()))
1369+
.collect(),
13611370
maybe_unused_trait_imports: self
13621371
.maybe_unused_trait_imports
13631372
.iter()

0 commit comments

Comments
 (0)