Clean up code for unused_must_use lint

This commit is contained in:
Manish Goregaokar 2014-09-16 22:53:19 +05:30
parent 3212d70302
commit 9c3a08551a

View file

@ -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) {