Skip to content

Commit 9c3a085

Browse files
committed
Clean up code for unused_must_use lint
1 parent 3212d70 commit 9c3a085

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/librustc/lint/builtin.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -689,11 +689,7 @@ impl LintPass for UnusedResult {
689689
ast::StmtSemi(ref expr, _) => &**expr,
690690
_ => return
691691
};
692-
let t = ty::expr_ty(cx.tcx, expr);
693-
match ty::get(t).sty {
694-
ty::ty_nil | ty::ty_bot | ty::ty_bool => return,
695-
_ => {}
696-
}
692+
697693
match expr.node {
698694
ast::ExprRet(..) => return,
699695
_ => {}
@@ -702,6 +698,7 @@ impl LintPass for UnusedResult {
702698
let t = ty::expr_ty(cx.tcx, expr);
703699
let mut warned = false;
704700
match ty::get(t).sty {
701+
ty::ty_nil | ty::ty_bot | ty::ty_bool => return,
705702
ty::ty_struct(did, _) |
706703
ty::ty_enum(did, _) => {
707704
if ast_util::is_local(did) {

0 commit comments

Comments
 (0)