]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/overflow_check_conditional.rs
Rollup merge of #85760 - ChrisDenton:path-doc-platform-specific, r=m-ou-se
[rust.git] / src / tools / clippy / clippy_lints / src / overflow_check_conditional.rs
index cf667c6e805341f46c18c61e5e4773c8bd562b5f..e222782c2cc8c597f2b7755b4098ff88ddd860e5 100644 (file)
@@ -31,11 +31,11 @@ impl<'tcx> LateLintPass<'tcx> for OverflowCheckConditional {
     fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
         let eq = |l, r| SpanlessEq::new(cx).eq_path_segment(l, r);
         if_chain! {
-            if let ExprKind::Binary(ref op, ref first, ref second) = expr.kind;
-            if let ExprKind::Binary(ref op2, ref ident1, ref ident2) = first.kind;
-            if let ExprKind::Path(QPath::Resolved(_, ref path1)) = ident1.kind;
-            if let ExprKind::Path(QPath::Resolved(_, ref path2)) = ident2.kind;
-            if let ExprKind::Path(QPath::Resolved(_, ref path3)) = second.kind;
+            if let ExprKind::Binary(ref op, first, second) = expr.kind;
+            if let ExprKind::Binary(ref op2, ident1, ident2) = first.kind;
+            if let ExprKind::Path(QPath::Resolved(_, path1)) = ident1.kind;
+            if let ExprKind::Path(QPath::Resolved(_, path2)) = ident2.kind;
+            if let ExprKind::Path(QPath::Resolved(_, path3)) = second.kind;
             if eq(&path1.segments[0], &path3.segments[0]) || eq(&path2.segments[0], &path3.segments[0]);
             if cx.typeck_results().expr_ty(ident1).is_integral();
             if cx.typeck_results().expr_ty(ident2).is_integral();
@@ -56,11 +56,11 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
         }
 
         if_chain! {
-            if let ExprKind::Binary(ref op, ref first, ref second) = expr.kind;
-            if let ExprKind::Binary(ref op2, ref ident1, ref ident2) = second.kind;
-            if let ExprKind::Path(QPath::Resolved(_, ref path1)) = ident1.kind;
-            if let ExprKind::Path(QPath::Resolved(_, ref path2)) = ident2.kind;
-            if let ExprKind::Path(QPath::Resolved(_, ref path3)) = first.kind;
+            if let ExprKind::Binary(ref op, first, second) = expr.kind;
+            if let ExprKind::Binary(ref op2, ident1, ident2) = second.kind;
+            if let ExprKind::Path(QPath::Resolved(_, path1)) = ident1.kind;
+            if let ExprKind::Path(QPath::Resolved(_, path2)) = ident2.kind;
+            if let ExprKind::Path(QPath::Resolved(_, path3)) = first.kind;
             if eq(&path1.segments[0], &path3.segments[0]) || eq(&path2.segments[0], &path3.segments[0]);
             if cx.typeck_results().expr_ty(ident1).is_integral();
             if cx.typeck_results().expr_ty(ident2).is_integral();