@@ -757,7 +757,6 @@ fn detect_absurd_comparison<'a>(cx: &LateContext, op: BinOp_, lhs: &'a Expr, rhs
757
757
use types:: ExtremeType :: * ;
758
758
use types:: AbsurdComparisonResult :: * ;
759
759
use utils:: comparisons:: * ;
760
- type Extr < ' a > = ExtremeExpr < ' a > ;
761
760
762
761
let normalized = normalize_comparison ( op, lhs, rhs) ;
763
762
let ( rel, normalized_lhs, normalized_rhs) = if let Some ( val) = normalized {
@@ -772,17 +771,17 @@ fn detect_absurd_comparison<'a>(cx: &LateContext, op: BinOp_, lhs: &'a Expr, rhs
772
771
Some ( match rel {
773
772
Rel :: Lt => {
774
773
match ( lx, rx) {
775
- ( Some ( l @ Extr { which : Maximum , .. } ) , _) => ( l, AlwaysFalse ) , // max < x
776
- ( _, Some ( r @ Extr { which : Minimum , .. } ) ) => ( r, AlwaysFalse ) , // x < min
774
+ ( Some ( l @ ExtremeExpr { which : Maximum , .. } ) , _) => ( l, AlwaysFalse ) , // max < x
775
+ ( _, Some ( r @ ExtremeExpr { which : Minimum , .. } ) ) => ( r, AlwaysFalse ) , // x < min
777
776
_ => return None ,
778
777
}
779
778
}
780
779
Rel :: Le => {
781
780
match ( lx, rx) {
782
- ( Some ( l @ Extr { which : Minimum , .. } ) , _) => ( l, AlwaysTrue ) , // min <= x
783
- ( Some ( l @ Extr { which : Maximum , .. } ) , _) => ( l, InequalityImpossible ) , //max <= x
784
- ( _, Some ( r @ Extr { which : Minimum , .. } ) ) => ( r, InequalityImpossible ) , // x <= min
785
- ( _, Some ( r @ Extr { which : Maximum , .. } ) ) => ( r, AlwaysTrue ) , // x <= max
781
+ ( Some ( l @ ExtremeExpr { which : Minimum , .. } ) , _) => ( l, AlwaysTrue ) , // min <= x
782
+ ( Some ( l @ ExtremeExpr { which : Maximum , .. } ) , _) => ( l, InequalityImpossible ) , //max <= x
783
+ ( _, Some ( r @ ExtremeExpr { which : Minimum , .. } ) ) => ( r, InequalityImpossible ) , // x <= min
784
+ ( _, Some ( r @ ExtremeExpr { which : Maximum , .. } ) ) => ( r, AlwaysTrue ) , // x <= max
786
785
_ => return None ,
787
786
}
788
787
}
0 commit comments