Skip to content

Commit 0047263

Browse files
authored
Rollup merge of #136644 - GuillaumeGomez:item-to-string, r=Urgau
Add `rustc_hir_pretty::item_to_string` function Another one needed for rustdoc. :) r? `@Urgau`
2 parents c906858 + f0966d2 commit 0047263

File tree

1 file changed

+4
-0
lines changed
  • compiler/rustc_hir_pretty/src

1 file changed

+4
-0
lines changed

compiler/rustc_hir_pretty/src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,10 @@ pub fn expr_to_string(ann: &dyn PpAnn, pat: &hir::Expr<'_>) -> String {
325325
to_string(ann, |s| s.print_expr(pat))
326326
}
327327

328+
pub fn item_to_string(ann: &dyn PpAnn, pat: &hir::Item<'_>) -> String {
329+
to_string(ann, |s| s.print_item(pat))
330+
}
331+
328332
impl<'a> State<'a> {
329333
fn bclose_maybe_open(&mut self, span: rustc_span::Span, close_box: bool) {
330334
self.maybe_print_comment(span.hi());

0 commit comments

Comments
 (0)