Add rustc_hir_pretty::expr_to_string
function
This commit is contained in:
parent
820bfffc25
commit
504ea670ae
1 changed files with 4 additions and 0 deletions
|
@ -321,6 +321,10 @@ pub fn pat_to_string(ann: &dyn PpAnn, pat: &hir::Pat<'_>) -> String {
|
||||||
to_string(ann, |s| s.print_pat(pat))
|
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> {
|
impl<'a> State<'a> {
|
||||||
fn bclose_maybe_open(&mut self, span: rustc_span::Span, close_box: bool) {
|
fn bclose_maybe_open(&mut self, span: rustc_span::Span, close_box: bool) {
|
||||||
self.maybe_print_comment(span.hi());
|
self.maybe_print_comment(span.hi());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue