Skip to content

Commit

Permalink
Fixes for elided lifetimes
Browse files Browse the repository at this point in the history
  • Loading branch information
mgr-inz-rafal committed Dec 28, 2019
1 parent 6223391 commit a208906
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions clippy_lints/src/modulo_arithmetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct OperandInfo {
is_integral: bool,
}

fn analyze_operand(operand: &Expr, cx: &LateContext<'_, '_>, expr: &Expr) -> Option<OperandInfo> {
fn analyze_operand(operand: &Expr<'_>, cx: &LateContext<'_, '_>, expr: &Expr<'_>) -> Option<OperandInfo> {
match constant(cx, cx.tables, operand) {
Some((Constant::Int(v), _)) => match cx.tables.expr_ty(expr).kind {
ty::Int(ity) => {
Expand Down Expand Up @@ -82,7 +82,7 @@ fn might_have_negative_value(t: &ty::TyS<'_>) -> bool {

fn check_const_operands<'a, 'tcx>(
cx: &LateContext<'a, 'tcx>,
expr: &'tcx Expr,
expr: &'tcx Expr<'_>,
lhs_operand: &OperandInfo,
rhs_operand: &OperandInfo,
) {
Expand All @@ -106,7 +106,7 @@ fn check_const_operands<'a, 'tcx>(
}
}

fn check_non_const_operands<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr, operand: &Expr) {
fn check_non_const_operands<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr<'_>, operand: &Expr<'_>) {
let operand_type = cx.tables.expr_ty(operand);
if might_have_negative_value(operand_type) {
span_lint_and_then(
Expand All @@ -125,7 +125,7 @@ fn check_non_const_operands<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, expr: &'tcx Ex
}

impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ModuloArithmetic {
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr<'_>) {
match &expr.kind {
ExprKind::Binary(op, lhs, rhs) | ExprKind::AssignOp(op, lhs, rhs) => {
if let BinOpKind::Rem = op.node {
Expand Down

0 comments on commit a208906

Please sign in to comment.