This commit is contained in:
Oliver Schneider 2017-04-10 15:14:54 +02:00
parent 03a0b18a85
commit 38b2215060

View File

@ -66,7 +66,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EqOp {
BiMul => cx.tcx.lang_items.mul_trait(), BiMul => cx.tcx.lang_items.mul_trait(),
BiDiv => cx.tcx.lang_items.div_trait(), BiDiv => cx.tcx.lang_items.div_trait(),
BiRem => cx.tcx.lang_items.rem_trait(), BiRem => cx.tcx.lang_items.rem_trait(),
BiAnd => None, BiAnd |
BiOr => None, BiOr => None,
BiBitXor => cx.tcx.lang_items.bitxor_trait(), BiBitXor => cx.tcx.lang_items.bitxor_trait(),
BiBitAnd => cx.tcx.lang_items.bitand_trait(), BiBitAnd => cx.tcx.lang_items.bitand_trait(),
@ -81,6 +81,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EqOp {
BiGt => cx.tcx.lang_items.ord_trait(), BiGt => cx.tcx.lang_items.ord_trait(),
}; };
if let Some(trait_id) = trait_id { if let Some(trait_id) = trait_id {
#[allow(match_same_arms)]
match (&left.node, &right.node) { match (&left.node, &right.node) {
// do not suggest to dereference literals // do not suggest to dereference literals
(&ExprLit(..), _) | (&ExprLit(..), _) |