Merge pull request #308 from Manishearth/unit_cmp

macro check for unit_cmp
This commit is contained in:
llogiq 2015-09-06 19:46:21 +02:00
commit 1569fd8c55

View File

@ -85,6 +85,7 @@ impl LintPass for UnitCmp {
}
fn check_expr(&mut self, cx: &Context, expr: &Expr) {
if in_macro(cx, expr.span) { return; }
if let ExprBinary(ref cmp, ref left, _) = expr.node {
let op = cmp.node;
let sty = &cx.tcx.expr_ty(left).sty;