Skip to content

Commit 5e0f9be

Browse files
print local inlined consts via the HIR map
1 parent 02bea3c commit 5e0f9be

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/librustdoc/clean/inline.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,11 @@ fn build_module(cx: &DocContext, did: DefId, visited: &mut FxHashSet<DefId>) ->
405405
}
406406

407407
pub fn print_inlined_const(cx: &DocContext, did: DefId) -> String {
408-
cx.tcx.rendered_const(did)
408+
if let Some(node_id) = cx.tcx.hir.as_local_node_id(did) {
409+
cx.tcx.hir.node_to_pretty_string(node_id)
410+
} else {
411+
cx.tcx.rendered_const(did)
412+
}
409413
}
410414

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

0 commit comments

Comments
 (0)