From 38189d77ccdce570111c0b5be28c32359d8f4153 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Sun, 3 Jan 2021 23:01:38 +0800 Subject: [PATCH] Merge matches! with match from rustc --- compiler/rustc_ast/src/ast.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index 8167bde0322f2..90507a2ae916e 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -1095,8 +1095,8 @@ impl Expr { match block.stmts.last().map(|last_stmt| &last_stmt.kind) { // Implicit return Some(StmtKind::Expr(_)) => true, - // Last statement is an explicit return? - Some(StmtKind::Semi(expr)) => matches!(expr.kind, ExprKind::Ret(_)), + // Last statement is an explicit return + Some(StmtKind::Semi(Expr { kind: ExprKind::Ret(_), .. })) => true, // This is a block that doesn't end in either an implicit or explicit return. _ => false, }