File tree 1 file changed +0
-18
lines changed
1 file changed +0
-18
lines changed Original file line number Diff line number Diff line change @@ -1112,24 +1112,6 @@ pub struct Expr {
1112
1112
}
1113
1113
1114
1114
impl 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
-
1133
1115
/// Is this expr either `N`, or `{ N }`.
1134
1116
///
1135
1117
/// 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