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 @@ -497,8 +497,14 @@ fn is_unnamable(tcx: TyCtxt<'_>, did: DefId) -> bool {
497
497
let mut cur_did = did;
498
498
while let Some ( parent) = tcx. opt_parent ( cur_did) {
499
499
match tcx. def_kind ( parent) {
500
- // items defined in these can be linked to
501
- DefKind :: Mod | DefKind :: Impl { .. } | DefKind :: ForeignMod => cur_did = parent,
500
+ // items defined in these can be linked to, as long as they are visible
501
+ DefKind :: Mod | DefKind :: ForeignMod => cur_did = parent,
502
+ // items in impls can be linked to,
503
+ // as long as we can link to the item the impl is on.
504
+ // since associated traits are not a thing,
505
+ // it should not be possible to refer to an impl item if
506
+ // the base type is not namable.
507
+ DefKind :: Impl { .. } => return false ,
502
508
// everything else does not have docs generated for it
503
509
_ => return true ,
504
510
}
You can’t perform that action at this time.
0 commit comments