diff options
| author | Michael Goulet <michael@errs.io> | 2022-10-26 19:19:37 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-10-26 19:19:44 +0000 |
| commit | d380d0387de4c0c0fd9bed40d1aa6f01457b061d (patch) | |
| tree | 885f468ce1547875960673e5996c9141e032aaed | |
| parent | 43dd3d514b6b11c5195de2fd8e665828801d0972 (diff) | |
| download | rust-d380d0387de4c0c0fd9bed40d1aa6f01457b061d.tar.gz rust-d380d0387de4c0c0fd9bed40d1aa6f01457b061d.zip | |
remove unused parser fn
| -rw-r--r-- | compiler/rustc_ast/src/ast.rs | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index 7112c267577..4ef43735a62 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -1112,24 +1112,6 @@ pub struct Expr { } impl Expr { - /// Returns `true` if this expression would be valid somewhere that expects a value; - /// for example, an `if` condition. - pub fn returns(&self) -> bool { - if let ExprKind::Block(ref block, _) = self.kind { - 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(_)), - // This is a block that doesn't end in either an implicit or explicit return. - _ => false, - } - } else { - // This is not a block, it is a value. - true - } - } - /// Is this expr either `N`, or `{ N }`. /// /// If this is not the case, name resolution does not resolve `N` when using |
