Merge commit 'b40ea209e7
' into clippyup
This commit is contained in:
parent
cde58f7174
commit
f6d1f368db
349 changed files with 10420 additions and 6013 deletions
|
@ -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 @@ impl<'tcx> LateLintPass<'tcx> for OverflowCheckConditional {
|
|||
}
|
||||
|
||||
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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue