1
Fork 0

Rollup merge of #136591 - GuillaumeGomez:expr-to-string, r=Urgau

Add `rustc_hir_pretty::expr_to_string` function

It'll allow me to work on a new rustdoc feature. :)

r? `@Urgau`
This commit is contained in:
Jubilee 2025-02-05 19:53:53 -08:00 committed by GitHub
commit d116ac4b0e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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