We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b66aa09 commit b47a322Copy full SHA for b47a322
tests/ui/manual_slice_size_calculation.rs
@@ -22,6 +22,12 @@ fn main() {
22
// False negatives:
23
let _ = 5 * size_of::<i32>() * s_i32.len(); // Ok (MISSED OPPORTUNITY)
24
let _ = size_of::<i32>() * 5 * s_i32.len(); // Ok (MISSED OPPORTUNITY)
25
+
26
+ let len = s_i32.len();
27
+ let size = size_of::<i32>();
28
+ let _ = len * size_of::<i32>(); // Ok (MISSED OPPORTUNITY)
29
+ let _ = s_i32.len() * size; // Ok (MISSED OPPORTUNITY)
30
+ let _ = len * size; // Ok (MISSED OPPORTUNITY)
31
}
32
33
const fn _const(s_i32: &[i32]) {
0 commit comments