Skip to content

Commit 743f932

Browse files
committed
Keep the previous behavior of register_res
Now that we're returning the `Res` of the associated item, not the trait itself, it got confused.
1 parent 519c854 commit 743f932

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/librustdoc/clean/utils.rs

+3
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,9 @@ pub fn register_res(cx: &DocContext<'_>, res: Res) -> DefId {
607607
Res::Def(DefKind::TyAlias, i) => (i, TypeKind::Typedef),
608608
Res::Def(DefKind::Enum, i) => (i, TypeKind::Enum),
609609
Res::Def(DefKind::Trait, i) => (i, TypeKind::Trait),
610+
Res::Def(DefKind::AssocTy | DefKind::AssocFn | DefKind::AssocConst, i) => {
611+
(cx.tcx.parent(i).unwrap(), TypeKind::Trait)
612+
}
610613
Res::Def(DefKind::Struct, i) => (i, TypeKind::Struct),
611614
Res::Def(DefKind::Union, i) => (i, TypeKind::Union),
612615
Res::Def(DefKind::Mod, i) => (i, TypeKind::Module),

0 commit comments

Comments
 (0)