From 3c4517659213c67e3ca6f3ef50ef9065385dca54 Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Wed, 11 Jan 2023 21:41:34 +0100 Subject: [PATCH] Expose some LoweringContext methods. --- compiler/rustc_ast_lowering/src/expr.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/compiler/rustc_ast_lowering/src/expr.rs b/compiler/rustc_ast_lowering/src/expr.rs index e21082894bde..51f290bc587e 100644 --- a/compiler/rustc_ast_lowering/src/expr.rs +++ b/compiler/rustc_ast_lowering/src/expr.rs @@ -1729,7 +1729,7 @@ pub(super) fn expr_drop_temps_mut( self.expr(span, hir::ExprKind::DropTemps(expr)) } - fn expr_match( + pub(super) fn expr_match( &mut self, span: Span, arg: &'hir hir::Expr<'hir>, @@ -1794,7 +1794,7 @@ pub(super) fn expr_str(&mut self, sp: Span, value: Symbol) -> hir::Expr<'hir> { ) } - fn expr_call_mut( + pub(super) fn expr_call_mut( &mut self, span: Span, e: &'hir hir::Expr<'hir>, @@ -1803,7 +1803,7 @@ fn expr_call_mut( self.expr(span, hir::ExprKind::Call(e, args)) } - fn expr_call( + pub(super) fn expr_call( &mut self, span: Span, e: &'hir hir::Expr<'hir>, @@ -1942,7 +1942,7 @@ pub(super) fn expr(&mut self, span: Span, kind: hir::ExprKind<'hir>) -> hir::Exp hir::Expr { hir_id, kind, span: self.lower_span(span) } } - fn expr_field( + pub(super) fn expr_field( &mut self, ident: Ident, expr: &'hir hir::Expr<'hir>, @@ -1957,7 +1957,11 @@ fn expr_field( } } - fn arm(&mut self, pat: &'hir hir::Pat<'hir>, expr: &'hir hir::Expr<'hir>) -> hir::Arm<'hir> { + pub(super) fn arm( + &mut self, + pat: &'hir hir::Pat<'hir>, + expr: &'hir hir::Expr<'hir>, + ) -> hir::Arm<'hir> { hir::Arm { hir_id: self.next_id(), pat,