1
Fork 0

Auto merge of #101562 - nnethercote:shrink-ast-Expr-harder, r=petrochenkov

Shrink `ast::Expr` harder

r? `@ghost`
This commit is contained in:
bors 2022-11-18 16:56:12 +00:00
commit 70fe5f08ff
46 changed files with 486 additions and 383 deletions

View file

@ -61,7 +61,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
hir::ExprKind::Call(f, self.lower_exprs(args))
}
}
ExprKind::MethodCall(ref seg, ref receiver, ref args, span) => {
ExprKind::MethodCall(box MethodCall { ref seg, ref receiver, ref args, span }) => {
let hir_seg = self.arena.alloc(self.lower_path_segment(
e.span,
seg,
@ -172,22 +172,22 @@ impl<'hir> LoweringContext<'_, 'hir> {
};
self.lower_expr_await(dot_await_span, expr)
}
ExprKind::Closure(
ExprKind::Closure(box Closure {
ref binder,
capture_clause,
asyncness,
movability,
ref decl,
ref fn_decl,
ref body,
fn_decl_span,
) => {
}) => {
if let Async::Yes { closure_id, .. } = asyncness {
self.lower_expr_async_closure(
binder,
capture_clause,
e.id,
closure_id,
decl,
fn_decl,
body,
fn_decl_span,
)
@ -197,7 +197,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
capture_clause,
e.id,
movability,
decl,
fn_decl,
body,
fn_decl_span,
)
@ -1105,7 +1105,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
fn extract_tuple_struct_path<'a>(
&mut self,
expr: &'a Expr,
) -> Option<(&'a Option<QSelf>, &'a Path)> {
) -> Option<(&'a Option<AstP<QSelf>>, &'a Path)> {
if let ExprKind::Path(qself, path) = &expr.kind {
// Does the path resolve to something disallowed in a tuple struct/variant pattern?
if let Some(partial_res) = self.resolver.get_partial_res(expr.id) {
@ -1125,7 +1125,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
fn extract_unit_struct_path<'a>(
&mut self,
expr: &'a Expr,
) -> Option<(&'a Option<QSelf>, &'a Path)> {
) -> Option<(&'a Option<AstP<QSelf>>, &'a Path)> {
if let ExprKind::Path(qself, path) = &expr.kind {
// Does the path resolve to something disallowed in a unit struct/variant pattern?
if let Some(partial_res) = self.resolver.get_partial_res(expr.id) {