Skip to content

Commit 9646446

Browse files
committed
Add lifetime parameter to 'Constant', after rebasing on upstream
1 parent 1d61fc1 commit 9646446

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clippy_lints/src/operators/const_comparisons.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ use clippy_utils::consts::{ConstEvalLateContext, Constant};
77
use if_chain::if_chain;
88
use rustc_hir::{BinOpKind, Expr, ExprKind};
99
use rustc_lint::LateContext;
10-
use rustc_middle::ty::{layout::HasTyCtxt, Ty, TypeckResults};
10+
use rustc_middle::ty::layout::HasTyCtxt;
11+
use rustc_middle::ty::{Ty, TypeckResults};
1112
use rustc_span::source_map::{Span, Spanned};
1213

1314
use clippy_utils::diagnostics::span_lint_and_note;
1415
use clippy_utils::source::snippet;
1516
use clippy_utils::SpanlessEq;
1617

17-
use super::IMPOSSIBLE_COMPARISONS;
18-
use super::REDUNDANT_COMPARISONS;
18+
use super::{IMPOSSIBLE_COMPARISONS, REDUNDANT_COMPARISONS};
1919

2020
// Extract a comparison between a const and non-const
2121
// Flip yoda conditionals, turnings expressions like `42 < x` into `x > 42`
2222
fn comparison_to_const<'tcx>(
2323
ctx: &mut ConstEvalLateContext<'_, 'tcx>,
2424
typeck: &TypeckResults<'tcx>,
2525
expr: &'tcx Expr<'tcx>,
26-
) -> Option<(CmpOp, &'tcx Expr<'tcx>, &'tcx Expr<'tcx>, Constant, Ty<'tcx>)> {
26+
) -> Option<(CmpOp, &'tcx Expr<'tcx>, &'tcx Expr<'tcx>, Constant<'tcx>, Ty<'tcx>)> {
2727
if_chain! {
2828
if let ExprKind::Binary(operator, left, right) = expr.kind;
2929
if let Ok(cmp_op) = CmpOp::try_from(operator.node);

0 commit comments

Comments
 (0)