}
let for_ = if let Some(did) = did.as_local() {
- let hir_id = tcx.hir().as_local_hir_id(did);
+ let hir_id = tcx.hir().local_def_id_to_hir_id(did);
match tcx.hir().expect_item(hir_id).kind {
hir::ItemKind::Impl { self_ty, .. } => self_ty.clean(cx),
_ => panic!("did given to build_impl was not an impl"),
let predicates = tcx.explicit_predicates_of(did);
let (trait_items, generics) = if let Some(did) = did.as_local() {
- let hir_id = tcx.hir().as_local_hir_id(did);
+ let hir_id = tcx.hir().local_def_id_to_hir_id(did);
match tcx.hir().expect_item(hir_id).kind {
hir::ItemKind::Impl { ref generics, ref items, .. } => (
items.iter().map(|item| tcx.hir().impl_item(item.id).clean(cx)).collect::<Vec<_>>(),
pub fn print_inlined_const(cx: &DocContext<'_>, did: DefId) -> String {
if let Some(did) = did.as_local() {
- let hir_id = cx.tcx.hir().as_local_hir_id(did);
+ let hir_id = cx.tcx.hir().local_def_id_to_hir_id(did);
rustc_hir_pretty::id_to_string(&cx.tcx.hir(), hir_id)
} else {
cx.tcx.rendered_const(did)
expr: print_inlined_const(cx, did),
value: clean::utils::print_evaluated_const(cx, did),
is_literal: did.as_local().map_or(false, |did| {
- clean::utils::is_literal_expr(cx, cx.tcx.hir().as_local_hir_id(did))
+ clean::utils::is_literal_expr(cx, cx.tcx.hir().local_def_id_to_hir_id(did))
}),
}
}