We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3212d70 commit 9c3a085Copy full SHA for 9c3a085
src/librustc/lint/builtin.rs
@@ -689,11 +689,7 @@ impl LintPass for UnusedResult {
689
ast::StmtSemi(ref expr, _) => &**expr,
690
_ => return
691
};
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
- }
+
697
match expr.node {
698
ast::ExprRet(..) => return,
699
_ => {}
@@ -702,6 +698,7 @@ impl LintPass for UnusedResult {
702
let t = ty::expr_ty(cx.tcx, expr);
703
let mut warned = false;
704
700
match ty::get(t).sty {
701
+ ty::ty_nil | ty::ty_bot | ty::ty_bool => return,
705
ty::ty_struct(did, _) |
706
ty::ty_enum(did, _) => {
707
if ast_util::is_local(did) {
0 commit comments