]> git.lizzy.rs Git - rust.git/blob - tests/ui/size_of_in_element_count/expressions.stderr
size_of_in_element_count: Disable lint on division by byte-size
[rust.git] / tests / ui / size_of_in_element_count / expressions.stderr
1 error: found a count of bytes instead of a count of elements of `T`
2   --> $DIR/expressions.rs:15:62
3    |
4 LL |     unsafe { copy_nonoverlapping(x.as_ptr(), y.as_mut_ptr(), size_of::<u8>() * SIZE) };
5    |                                                              ^^^^^^^^^^^^^^^^^^^^^^
6    |
7    = note: `-D clippy::size-of-in-element-count` implied by `-D warnings`
8    = help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type
9
10 error: found a count of bytes instead of a count of elements of `T`
11   --> $DIR/expressions.rs:18:62
12    |
13 LL |     unsafe { copy_nonoverlapping(x.as_ptr(), y.as_mut_ptr(), HALF_SIZE * size_of_val(&x[0]) * 2) };
14    |                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15    |
16    = help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type
17
18 error: found a count of bytes instead of a count of elements of `T`
19   --> $DIR/expressions.rs:21:47
20    |
21 LL |     unsafe { copy(x.as_ptr(), y.as_mut_ptr(), DOUBLE_SIZE * size_of::<u8>() / 2) };
22    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23    |
24    = help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type
25
26 error: found a count of bytes instead of a count of elements of `T`
27   --> $DIR/expressions.rs:30:47
28    |
29 LL |     unsafe { copy(x.as_ptr(), y.as_mut_ptr(), DOUBLE_SIZE / (2 / size_of::<u8>())) };
30    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
31    |
32    = help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type
33
34 error: aborting due to 4 previous errors
35