Skip to content

Commit

Permalink
Unrolled build for rust-lang#136591
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#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`
  • Loading branch information
rust-timer authored Feb 6, 2025
2 parents c753cb9 + 504ea67 commit 9710568
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compiler/rustc_hir_pretty/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 9710568

Please # to comment.