@@ -82,8 +82,8 @@ pub(super) fn check<'tcx>(
82
82
83
83
then {
84
84
if left_cmp_op. direction( ) == right_cmp_op. direction( ) {
85
- let lhs_str = snippet( cx, left_cond. span, "" ) ;
86
- let rhs_str = snippet( cx, right_cond. span, "" ) ;
85
+ let lhs_str = snippet( cx, left_cond. span, "<lhs> " ) ;
86
+ let rhs_str = snippet( cx, right_cond. span, "<rhs> " ) ;
87
87
// We already know that either side of `&&` has no effect,
88
88
// but emit a different error message depending on which side it is
89
89
if left_side_is_useless( left_cmp_op, ordering) {
@@ -109,9 +109,9 @@ pub(super) fn check<'tcx>(
109
109
// because code triggering this lint probably not behaving correctly in the first place
110
110
}
111
111
else if !comparison_is_possible( left_cmp_op. direction( ) , ordering) {
112
- let expr_str = snippet( cx, left_expr. span, "" ) ;
113
- let lhs_str = snippet( cx, left_const_expr. span, "" ) ;
114
- let rhs_str = snippet( cx, right_const_expr. span, "" ) ;
112
+ let expr_str = snippet( cx, left_expr. span, ".. " ) ;
113
+ let lhs_str = snippet( cx, left_const_expr. span, "<lhs> " ) ;
114
+ let rhs_str = snippet( cx, right_const_expr. span, "<rhs> " ) ;
115
115
let note = match ordering {
116
116
Ordering :: Less => format!( "since `{lhs_str}` < `{rhs_str}`, the expression evaluates to false for any value of `{expr_str}`" ) ,
117
117
Ordering :: Equal => format!( "`{expr_str}` cannot simultaneously be greater than and less than `{lhs_str}`" ) ,
0 commit comments