File tree Expand file tree Collapse file tree 1 file changed +0
-18
lines changed Expand file tree Collapse file tree 1 file changed +0
-18
lines changed Original file line number Diff line number Diff line change @@ -1112,24 +1112,6 @@ pub struct Expr {
11121112}
11131113
11141114impl Expr {
1115- /// Returns `true` if this expression would be valid somewhere that expects a value;
1116- /// for example, an `if` condition.
1117- pub fn returns ( & self ) -> bool {
1118- if let ExprKind :: Block ( ref block, _) = self . kind {
1119- match block. stmts . last ( ) . map ( |last_stmt| & last_stmt. kind ) {
1120- // Implicit return
1121- Some ( StmtKind :: Expr ( _) ) => true ,
1122- // Last statement is an explicit return?
1123- Some ( StmtKind :: Semi ( expr) ) => matches ! ( expr. kind, ExprKind :: Ret ( _) ) ,
1124- // This is a block that doesn't end in either an implicit or explicit return.
1125- _ => false ,
1126- }
1127- } else {
1128- // This is not a block, it is a value.
1129- true
1130- }
1131- }
1132-
11331115 /// Is this expr either `N`, or `{ N }`.
11341116 ///
11351117 /// If this is not the case, name resolution does not resolve `N` when using
You can’t perform that action at this time.
0 commit comments