File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -486,8 +486,14 @@ fn is_unnamable(tcx: TyCtxt<'_>, did: DefId) -> bool {
486
486
let mut cur_did = did;
487
487
while let Some ( parent) = tcx. opt_parent ( cur_did) {
488
488
match tcx. def_kind ( parent) {
489
- // items defined in these can be linked to
490
- DefKind :: Mod | DefKind :: Impl { .. } | DefKind :: ForeignMod => cur_did = parent,
489
+ // items defined in these can be linked to, as long as they are visible
490
+ DefKind :: Mod | DefKind :: ForeignMod => cur_did = parent,
491
+ // items in impls can be linked to,
492
+ // as long as we can link to the item the impl is on.
493
+ // since associated traits are not a thing,
494
+ // it should not be possible to refer to an impl item if
495
+ // the base type is not namable.
496
+ DefKind :: Impl { .. } => return false ,
491
497
// everything else does not have docs generated for it
492
498
_ => return true ,
493
499
}
You can’t perform that action at this time.
0 commit comments