Skip to content

Commit f2a7e71

Browse files
committed
Remove warning about non-void expr stmts.
1 parent c20ea9e commit f2a7e71

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/comp/middle/typeck.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,12 +1236,6 @@ fn check_stmt(&fn_ctxt fcx, &@ast.stmt stmt)
12361236

12371237
case (ast.stmt_expr(?expr)) {
12381238
auto expr_t = check_expr(fcx, expr);
1239-
if (!are_compatible(fcx, expr_ty(expr_t), plain_ty(ty_nil))) {
1240-
// TODO: real warning function
1241-
log "warning: expression used as statement should have " +
1242-
"void type";
1243-
}
1244-
12451239
ret @fold.respan[ast.stmt_](stmt.span, ast.stmt_expr(expr_t));
12461240
}
12471241
}

0 commit comments

Comments
 (0)