merge as_local_hir_id with local_def_id_to_hir_id

This commit is contained in:
Bastian Kauschke
2020-08-12 12:22:56 +02:00
parent 4745cbe83e
commit cd53760cc7
82 changed files with 241 additions and 237 deletions

View File

@@ -471,7 +471,7 @@ pub fn print_const(cx: &DocContext<'_>, n: &'tcx ty::Const<'_>) -> String {
match n.val {
ty::ConstKind::Unevaluated(def, _, promoted) => {
let mut s = if let Some(def) = def.as_local() {
let hir_id = cx.tcx.hir().as_local_hir_id(def.did);
let hir_id = cx.tcx.hir().local_def_id_to_hir_id(def.did);
print_const_expr(cx, cx.tcx.hir().body_owned_by(hir_id))
} else {
inline::print_inlined_const(cx, def.did)