Skip to content

Commit ca61286

Browse files
pull local types from the HIR instead of tcx
1 parent 5254548 commit ca61286

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/librustdoc/clean/inline.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,16 @@ pub fn build_impl(cx: &DocContext, did: DefId, ret: &mut Vec<clean::Item>) {
314314
}
315315
}
316316

317-
let for_ = tcx.type_of(did).clean(cx);
317+
let for_ = if let Some(nodeid) = tcx.hir.as_local_node_id(did) {
318+
match tcx.hir.expect_item(nodeid).node {
319+
hir::ItemKind::Impl(.., ref t, _) => {
320+
t.clean(cx)
321+
}
322+
_ => panic!("did given to build_impl was not an impl"),
323+
}
324+
} else {
325+
tcx.type_of(did).clean(cx)
326+
};
318327

319328
// Only inline impl if the implementing type is
320329
// reachable in rustdoc generated documentation

0 commit comments

Comments
 (0)