use rustc::lint::*;
use utils::{SpanlessEq, span_lint};
-/// **What it does:** This lint checks for equal operands to comparison, logical and bitwise,
-/// difference and division binary operators (`==`, `>`, etc., `&&`, `||`, `&`, `|`, `^`, `-` and
-/// `/`).
+/// **What it does:** Checks for equal operands to comparison, logical and
+/// bitwise, difference and division binary operators (`==`, `>`, etc., `&&`,
+/// `||`, `&`, `|`, `^`, `-` and `/`).
///
/// **Why is this bad?** This is usually just a typo or a copy and paste error.
///
-/// **Known problems:** False negatives: We had some false positives regarding calls (notably
-/// [racer](https://github.com/phildawes/racer) had one instance of `x.pop() && x.pop()`), so we
-/// removed matching any function or method calls. We may introduce a whitelist of known pure
-/// functions in the future.
+/// **Known problems:** False negatives: We had some false positives regarding
+/// calls (notably [racer](https://github.com/phildawes/racer) had one instance
+/// of `x.pop() && x.pop()`), so we removed matching any function or method
+/// calls. We may introduce a whitelist of known pure functions in the future.
///
/// **Example:**
/// ```rust
}
}
-impl LateLintPass for EqOp {
- fn check_expr(&mut self, cx: &LateContext, e: &Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EqOp {
+ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
if let ExprBinary(ref op, ref left, ref right) = e.node {
if is_valid_operator(op) && SpanlessEq::new(cx).ignore_fn().eq_expr(left, right) {
span_lint(cx,