mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-24 12:03:28 +00:00
47 lines
1.9 KiB
Text
47 lines
1.9 KiB
Text
error: manual slice size calculation
|
|
--> tests/ui/manual_slice_size_calculation.rs:15:13
|
|
|
|
|
LL | let _ = s_i32.len() * size_of::<i32>(); // WARNING
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::mem::size_of_val(s_i32)`
|
|
|
|
|
= note: `-D clippy::manual-slice-size-calculation` implied by `-D warnings`
|
|
= help: to override `-D warnings` add `#[allow(clippy::manual_slice_size_calculation)]`
|
|
|
|
error: manual slice size calculation
|
|
--> tests/ui/manual_slice_size_calculation.rs:16:13
|
|
|
|
|
LL | let _ = size_of::<i32>() * s_i32.len(); // WARNING
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::mem::size_of_val(s_i32)`
|
|
|
|
error: manual slice size calculation
|
|
--> tests/ui/manual_slice_size_calculation.rs:17:13
|
|
|
|
|
LL | let _ = size_of::<i32>() * s_i32.len() * 5; // WARNING
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::mem::size_of_val(s_i32)`
|
|
|
|
error: manual slice size calculation
|
|
--> tests/ui/manual_slice_size_calculation.rs:21:13
|
|
|
|
|
LL | let _ = len * size_of::<i32>(); // WARNING
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::mem::size_of_val(s_i32)`
|
|
|
|
error: manual slice size calculation
|
|
--> tests/ui/manual_slice_size_calculation.rs:22:13
|
|
|
|
|
LL | let _ = s_i32.len() * size; // WARNING
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `std::mem::size_of_val(s_i32)`
|
|
|
|
error: manual slice size calculation
|
|
--> tests/ui/manual_slice_size_calculation.rs:23:13
|
|
|
|
|
LL | let _ = len * size; // WARNING
|
|
| ^^^^^^^^^^ help: try: `std::mem::size_of_val(s_i32)`
|
|
|
|
error: manual slice size calculation
|
|
--> tests/ui/manual_slice_size_calculation.rs:25:13
|
|
|
|
|
LL | let _ = external!(&[1u64][..]).len() * size_of::<u64>();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::mem::size_of_val(external!(&[1u64][..]))`
|
|
|
|
error: aborting due to 7 previous errors
|
|
|