@@ -7,23 +7,23 @@ use clippy_utils::consts::{ConstEvalLateContext, Constant};
77use if_chain:: if_chain;
88use rustc_hir:: { BinOpKind , Expr , ExprKind } ;
99use 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 } ;
1112use rustc_span:: source_map:: { Span , Spanned } ;
1213
1314use clippy_utils:: diagnostics:: span_lint_and_note;
1415use clippy_utils:: source:: snippet;
1516use 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`
2222fn 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