Skip to content

Commit

Permalink
print local inlined consts via the HIR map
Browse files Browse the repository at this point in the history
  • Loading branch information
QuietMisdreavus committed Sep 20, 2018
1 parent 02bea3c commit 5e0f9be
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/librustdoc/clean/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,11 @@ fn build_module(cx: &DocContext, did: DefId, visited: &mut FxHashSet<DefId>) ->
}

pub fn print_inlined_const(cx: &DocContext, did: DefId) -> String {
cx.tcx.rendered_const(did)
if let Some(node_id) = cx.tcx.hir.as_local_node_id(did) {
cx.tcx.hir.node_to_pretty_string(node_id)
} else {
cx.tcx.rendered_const(did)
}
}

fn build_const(cx: &DocContext, did: DefId) -> clean::Constant {
Expand Down

0 comments on commit 5e0f9be

Please sign in to comment.