Modify as_local_hir_id
to accept a LocalDefId
instead of a DefId
This commit is contained in:
parent
92fb59d7f3
commit
6148db719f
86 changed files with 579 additions and 444 deletions
|
@ -473,7 +473,9 @@ pub fn name_from_pat(p: &hir::Pat) -> String {
|
|||
pub fn print_const(cx: &DocContext<'_>, n: &'tcx ty::Const<'_>) -> String {
|
||||
match n.val {
|
||||
ty::ConstKind::Unevaluated(def_id, _, promoted) => {
|
||||
let mut s = if let Some(hir_id) = cx.tcx.hir().as_local_hir_id(def_id) {
|
||||
let mut s = if let Some(hir_id) =
|
||||
def_id.as_local().map(|def_id| cx.tcx.hir().as_local_hir_id(def_id).unwrap())
|
||||
{
|
||||
print_const_expr(cx, cx.tcx.hir().body_owned_by(hir_id))
|
||||
} else {
|
||||
inline::print_inlined_const(cx, def_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue