@@ -375,13 +375,9 @@ pub(in crate::rmeta) fn provide(providers: &mut Providers) {
375
375
use std:: collections:: vec_deque:: VecDeque ;
376
376
377
377
let mut visible_parent_map: DefIdMap < DefId > = Default :: default ( ) ;
378
- // This is a secondary visible_parent_map, storing the DefId of
379
- // parents that re-export the child as `_` or module parents
380
- // which are `#[doc(hidden)]`. Since we prefer paths that don't
381
- // do this, merge this map at the end, only if we're missing
382
- // keys from the former.
383
- // This is a rudimentary check that does not catch all cases,
384
- // just the easiest.
378
+ // This is a secondary visible_parent_map, storing the DefId of parents that re-export
379
+ // the child as `_`. Since we prefer parents that don't do this, merge this map at the
380
+ // end, only if we're missing any keys from the former.
385
381
let mut fallback_map: DefIdMap < DefId > = Default :: default ( ) ;
386
382
387
383
// Issue 46112: We want the map to prefer the shortest
@@ -416,11 +412,6 @@ pub(in crate::rmeta) fn provide(providers: &mut Providers) {
416
412
return ;
417
413
}
418
414
419
- if ty:: util:: is_doc_hidden ( tcx, parent) {
420
- fallback_map. insert ( def_id, parent) ;
421
- return ;
422
- }
423
-
424
415
match visible_parent_map. entry ( def_id) {
425
416
Entry :: Occupied ( mut entry) => {
426
417
// If `child` is defined in crate `cnum`, ensure
@@ -448,9 +439,8 @@ pub(in crate::rmeta) fn provide(providers: &mut Providers) {
448
439
}
449
440
}
450
441
451
- // Fill in any missing entries with the less preferable path.
452
- // If this path re-exports the child as `_`, we still use this
453
- // path in a diagnostic that suggests importing `::*`.
442
+ // Fill in any missing entries with the (less preferable) path ending in `::_`.
443
+ // We still use this path in a diagnostic that suggests importing `::*`.
454
444
for ( child, parent) in fallback_map {
455
445
visible_parent_map. entry ( child) . or_insert ( parent) ;
456
446
}
0 commit comments