File tree 3 files changed +28
-4
lines changed
clippy_lints/src/operators
3 files changed +28
-4
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ pub(crate) fn check<'tcx>(
86
86
left. span ,
87
87
"use the left value directly" ,
88
88
lsnip,
89
- Applicability :: MaybeIncorrect , // FIXME #2597
89
+ Applicability :: MachineApplicable ,
90
90
) ;
91
91
} ,
92
92
) ;
@@ -105,7 +105,7 @@ pub(crate) fn check<'tcx>(
105
105
right. span ,
106
106
"use the right value directly" ,
107
107
rsnip,
108
- Applicability :: MaybeIncorrect , // FIXME #2597
108
+ Applicability :: MachineApplicable ,
109
109
) ;
110
110
} ,
111
111
) ;
@@ -137,7 +137,7 @@ pub(crate) fn check<'tcx>(
137
137
left. span ,
138
138
"use the left value directly" ,
139
139
lsnip,
140
- Applicability :: MaybeIncorrect , // FIXME #2597
140
+ Applicability :: MachineApplicable ,
141
141
) ;
142
142
} ,
143
143
) ;
@@ -164,7 +164,7 @@ pub(crate) fn check<'tcx>(
164
164
right. span ,
165
165
"use the right value directly" ,
166
166
rsnip,
167
- Applicability :: MaybeIncorrect , // FIXME #2597
167
+ Applicability :: MachineApplicable ,
168
168
) ;
169
169
} ) ;
170
170
}
Original file line number Diff line number Diff line change @@ -98,3 +98,15 @@ impl Mul<A> for A {
98
98
self * &rhs
99
99
}
100
100
}
101
+
102
+ mod issue_2597 {
103
+ fn ex1() {
104
+ let a: &str = "abc";
105
+ let b: String = "abc".to_owned();
106
+ println!("{}", a > &b);
107
+ }
108
+
109
+ pub fn ex2<T: Ord + PartialOrd>(array: &[T], val: &T, idx: usize) -> bool {
110
+ &array[idx] < val
111
+ }
112
+ }
Original file line number Diff line number Diff line change @@ -98,3 +98,15 @@ impl Mul<A> for A {
98
98
self * & rhs
99
99
}
100
100
}
101
+
102
+ mod issue_2597 {
103
+ fn ex1 ( ) {
104
+ let a: & str = "abc" ;
105
+ let b: String = "abc" . to_owned ( ) ;
106
+ println ! ( "{}" , a > & b) ;
107
+ }
108
+
109
+ pub fn ex2 < T : Ord + PartialOrd > ( array : & [ T ] , val : & T , idx : usize ) -> bool {
110
+ & array[ idx] < val
111
+ }
112
+ }
You can’t perform that action at this time.
0 commit comments