Add rustc_hir_pretty::item_to_string function

This commit is contained in:
Guillaume Gomez
2025-02-06 14:45:28 +01:00
parent 504ea670ae
commit f0966d20ad

View File

@@ -325,6 +325,10 @@ pub fn expr_to_string(ann: &dyn PpAnn, pat: &hir::Expr<'_>) -> String {
to_string(ann, |s| s.print_expr(pat))
}
pub fn item_to_string(ann: &dyn PpAnn, pat: &hir::Item<'_>) -> String {
to_string(ann, |s| s.print_item(pat))
}
impl<'a> State<'a> {
fn bclose_maybe_open(&mut self, span: rustc_span::Span, close_box: bool) {
self.maybe_print_comment(span.hi());