@@ -5,7 +5,6 @@ use crate::rmeta::encoder;
5
5
6
6
use rustc_ast as ast;
7
7
use rustc_data_structures:: stable_map:: FxHashMap ;
8
- use rustc_hir as hir;
9
8
use rustc_hir:: def:: { CtorKind , DefKind } ;
10
9
use rustc_hir:: def_id:: { CrateNum , DefId , DefIdMap , CRATE_DEF_INDEX , LOCAL_CRATE } ;
11
10
use rustc_hir:: definitions:: { DefKey , DefPath , DefPathHash } ;
@@ -326,28 +325,27 @@ pub fn provide(providers: &mut Providers) {
326
325
// (restrict scope of mutable-borrow of `visible_parent_map`)
327
326
{
328
327
let visible_parent_map = & mut visible_parent_map;
329
- let mut add_child =
330
- |bfs_queue : & mut VecDeque < _ > , child : & Export < hir:: HirId > , parent : DefId | {
331
- if child. vis != ty:: Visibility :: Public {
332
- return ;
333
- }
328
+ let mut add_child = |bfs_queue : & mut VecDeque < _ > , child : & Export , parent : DefId | {
329
+ if child. vis != ty:: Visibility :: Public {
330
+ return ;
331
+ }
334
332
335
- if let Some ( child) = child. res . opt_def_id ( ) {
336
- match visible_parent_map. entry ( child) {
337
- Entry :: Occupied ( mut entry) => {
338
- // If `child` is defined in crate `cnum`, ensure
339
- // that it is mapped to a parent in `cnum`.
340
- if child. is_local ( ) && entry. get ( ) . is_local ( ) {
341
- entry. insert ( parent) ;
342
- }
343
- }
344
- Entry :: Vacant ( entry) => {
333
+ if let Some ( child) = child. res . opt_def_id ( ) {
334
+ match visible_parent_map. entry ( child) {
335
+ Entry :: Occupied ( mut entry) => {
336
+ // If `child` is defined in crate `cnum`, ensure
337
+ // that it is mapped to a parent in `cnum`.
338
+ if child. is_local ( ) && entry. get ( ) . is_local ( ) {
345
339
entry. insert ( parent) ;
346
- bfs_queue. push_back ( child) ;
347
340
}
348
341
}
342
+ Entry :: Vacant ( entry) => {
343
+ entry. insert ( parent) ;
344
+ bfs_queue. push_back ( child) ;
345
+ }
349
346
}
350
- } ;
347
+ }
348
+ } ;
351
349
352
350
while let Some ( def) = bfs_queue. pop_front ( ) {
353
351
for child in tcx. item_children ( def) . iter ( ) {
@@ -393,11 +391,7 @@ impl CStore {
393
391
self . get_crate_data ( def. krate ) . get_visibility ( def. index )
394
392
}
395
393
396
- pub fn item_children_untracked (
397
- & self ,
398
- def_id : DefId ,
399
- sess : & Session ,
400
- ) -> Vec < Export < hir:: HirId > > {
394
+ pub fn item_children_untracked ( & self , def_id : DefId , sess : & Session ) -> Vec < Export > {
401
395
let mut result = vec ! [ ] ;
402
396
self . get_crate_data ( def_id. krate ) . each_child_of_item (
403
397
def_id. index ,
0 commit comments