Skip to content

Commit 978c13a

Browse files
pull local types from the HIR instead of tcx
1 parent bfd2b34 commit 978c13a

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
@@ -315,7 +315,16 @@ pub fn build_impl(cx: &DocContext, did: DefId, ret: &mut Vec<clean::Item>) {
315315
}
316316
}
317317

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

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

0 commit comments

Comments
 (0)