Skip to content

Commit

Permalink
Keep the previous behavior of register_res
Browse files Browse the repository at this point in the history
Now that we're returning the `Res` of the associated item,
not the trait itself, it got confused.
  • Loading branch information
jyn514 committed Aug 3, 2020
1 parent 519c854 commit 743f932
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/librustdoc/clean/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,9 @@ pub fn register_res(cx: &DocContext<'_>, res: Res) -> DefId {
Res::Def(DefKind::TyAlias, i) => (i, TypeKind::Typedef),
Res::Def(DefKind::Enum, i) => (i, TypeKind::Enum),
Res::Def(DefKind::Trait, i) => (i, TypeKind::Trait),
Res::Def(DefKind::AssocTy | DefKind::AssocFn | DefKind::AssocConst, i) => {
(cx.tcx.parent(i).unwrap(), TypeKind::Trait)
}
Res::Def(DefKind::Struct, i) => (i, TypeKind::Struct),
Res::Def(DefKind::Union, i) => (i, TypeKind::Union),
Res::Def(DefKind::Mod, i) => (i, TypeKind::Module),
Expand Down

0 comments on commit 743f932

Please sign in to comment.