1
Fork 0

pull local types from the HIR instead of tcx

This commit is contained in:
QuietMisdreavus 2018-08-14 15:19:15 -05:00
parent bfd2b34454
commit 978c13aa02

View file

@ -315,7 +315,16 @@ pub fn build_impl(cx: &DocContext, did: DefId, ret: &mut Vec<clean::Item>) {
}
}
let for_ = tcx.type_of(did).clean(cx);
let for_ = if let Some(nodeid) = tcx.hir.as_local_node_id(did) {
match tcx.hir.expect_item(nodeid).node {
hir::ItemKind::Impl(.., ref t, _) => {
t.clean(cx)
}
_ => panic!("did given to build_impl was not an impl"),
}
} else {
tcx.type_of(did).clean(cx)
};
// Only inline impl if the implementing type is
// reachable in rustdoc generated documentation