about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2014-09-16 22:53:19 +0530
committerManish Goregaokar <manishsmail@gmail.com>2014-09-16 22:53:19 +0530
commit9c3a08551ae9c0ee230616e2a40c2b0382276d8a (patch)
tree25f725e51bba509d02eba589c051d0166e1f4edf
parent3212d70302074bb6fc28d077e1cc4ed870fcb091 (diff)
Clean up code for unused_must_use lint
-rw-r--r--src/librustc/lint/builtin.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/librustc/lint/builtin.rs b/src/librustc/lint/builtin.rs
index 58c05bee443..1af6fbbfbf9 100644
--- a/src/librustc/lint/builtin.rs
+++ b/src/librustc/lint/builtin.rs
@@ -689,11 +689,7 @@ impl LintPass for UnusedResult {
             ast::StmtSemi(ref expr, _) => &**expr,
             _ => return
         };
-        let t = ty::expr_ty(cx.tcx, expr);
-        match ty::get(t).sty {
-            ty::ty_nil | ty::ty_bot | ty::ty_bool => return,
-            _ => {}
-        }
+
         match expr.node {
             ast::ExprRet(..) => return,
             _ => {}
@@ -702,6 +698,7 @@ impl LintPass for UnusedResult {
         let t = ty::expr_ty(cx.tcx, expr);
         let mut warned = false;
         match ty::get(t).sty {
+            ty::ty_nil | ty::ty_bot | ty::ty_bool => return,
             ty::ty_struct(did, _) |
             ty::ty_enum(did, _) => {
                 if ast_util::is_local(did) {