diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 666d418cc0e..ae329dc62f1 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -2295,20 +2295,19 @@ fn clean(&self, cx: &DocContext<'_>) -> Item { ) } else { let vis = item.vis.clean(cx); - let vis_printed_with_space = - vis.print_with_space(cx.tcx, cx.tcx.hir().local_def_id(item.hir_id).to_def_id()); + let def_id = cx.tcx.hir().local_def_id(item.hir_id).to_def_id(); if matchers.len() <= 1 { format!( "{}macro {}{} {{\n ...\n}}", - vis_printed_with_space, + vis.print_with_space(cx.tcx, def_id), name, matchers.iter().map(|span| span.to_src(cx)).collect::(), ) } else { format!( "{}macro {} {{\n{}}}", - vis_printed_with_space, + vis.print_with_space(cx.tcx, def_id), name, matchers .iter()