diff options
| author | QuietMisdreavus <grey@quietmisdreavus.net> | 2018-08-07 11:30:57 -0500 |
|---|---|---|
| committer | QuietMisdreavus <grey@quietmisdreavus.net> | 2018-09-20 05:42:21 -0500 |
| commit | 5e0f9be6707c304bbcfdd22a8fb857e49a013f57 (patch) | |
| tree | 183a6024c8899533886788b0dbb4751112d4f45e /src | |
| parent | 02bea3c581bf7127a5ec77d1d3d7a5a513fcf6c5 (diff) | |
| download | rust-5e0f9be6707c304bbcfdd22a8fb857e49a013f57.tar.gz rust-5e0f9be6707c304bbcfdd22a8fb857e49a013f57.zip | |
print local inlined consts via the HIR map
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/clean/inline.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs index 684063beac3..65a144b3ca4 100644 --- a/src/librustdoc/clean/inline.rs +++ b/src/librustdoc/clean/inline.rs @@ -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 { |
