summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/size_of_in_element_count/functions.stderr
blob: c1e824167b7f35d5156bab036453a413e1bcb242 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
error: found a count of bytes instead of a count of elements of `T`
  --> $DIR/functions.rs:18:68
   |
LL |     unsafe { copy_nonoverlapping::<u8>(x.as_ptr(), y.as_mut_ptr(), size_of::<u8>()) };
   |                                                                    ^^^^^^^^^^^^^^^
   |
   = note: `-D clippy::size-of-in-element-count` implied by `-D warnings`
   = help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type

error: found a count of bytes instead of a count of elements of `T`
  --> $DIR/functions.rs:19:62
   |
LL |     unsafe { copy_nonoverlapping(x.as_ptr(), y.as_mut_ptr(), size_of_val(&x[0])) };
   |                                                              ^^^^^^^^^^^^^^^^^^
   |
   = help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type

error: found a count of bytes instead of a count of elements of `T`
  --> $DIR/functions.rs:21:49
   |
LL |     unsafe { x.as_ptr().copy_to(y.as_mut_ptr(), size_of::<u8>()) };
   |                                                 ^^^^^^^^^^^^^^^
   |
   = help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type

error: found a count of bytes instead of a count of elements of `T`
  --> $DIR/functions.rs:22:64
   |
LL |     unsafe { x.as_ptr().copy_to_nonoverlapping(y.as_mut_ptr(), size_of::<u8>()) };
   |                                                                ^^^^^^^^^^^^^^^
   |
   = help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type

error: found a count of bytes instead of a count of elements of `T`
  --> $DIR/functions.rs:23:51
   |
LL |     unsafe { y.as_mut_ptr().copy_from(x.as_ptr(), size_of::<u8>()) };
   |                                                   ^^^^^^^^^^^^^^^
   |
   = help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type

error: found a count of bytes instead of a count of elements of `T`
  --> $DIR/functions.rs:24:66
   |
LL |     unsafe { y.as_mut_ptr().copy_from_nonoverlapping(x.as_ptr(), size_of::<u8>()) };
   |                                                                  ^^^^^^^^^^^^^^^
   |
   = help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type

error: found a count of bytes instead of a count of elements of `T`
  --> $DIR/functions.rs:26:47
   |
LL |     unsafe { copy(x.as_ptr(), y.as_mut_ptr(), size_of::<u8>()) };
   |                                               ^^^^^^^^^^^^^^^
   |
   = help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type

error: found a count of bytes instead of a count of elements of `T`
  --> $DIR/functions.rs:27:47
   |
LL |     unsafe { copy(x.as_ptr(), y.as_mut_ptr(), size_of_val(&x[0])) };
   |                                               ^^^^^^^^^^^^^^^^^^
   |
   = help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type

error: found a count of bytes instead of a count of elements of `T`
  --> $DIR/functions.rs:29:46
   |
LL |     unsafe { y.as_mut_ptr().write_bytes(0u8, size_of::<u8>() * SIZE) };
   |                                              ^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type

error: found a count of bytes instead of a count of elements of `T`
  --> $DIR/functions.rs:30:47
   |
LL |     unsafe { write_bytes(y.as_mut_ptr(), 0u8, size_of::<u8>() * SIZE) };
   |                                               ^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type

error: found a count of bytes instead of a count of elements of `T`
  --> $DIR/functions.rs:32:66
   |
LL |     unsafe { swap_nonoverlapping(y.as_mut_ptr(), x.as_mut_ptr(), size_of::<u8>() * SIZE) };
   |                                                                  ^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type

error: found a count of bytes instead of a count of elements of `T`
  --> $DIR/functions.rs:34:46
   |
LL |     slice_from_raw_parts_mut(y.as_mut_ptr(), size_of::<u8>() * SIZE);
   |                                              ^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type

error: found a count of bytes instead of a count of elements of `T`
  --> $DIR/functions.rs:35:38
   |
LL |     slice_from_raw_parts(y.as_ptr(), size_of::<u8>() * SIZE);
   |                                      ^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type

error: found a count of bytes instead of a count of elements of `T`
  --> $DIR/functions.rs:37:49
   |
LL |     unsafe { from_raw_parts_mut(y.as_mut_ptr(), size_of::<u8>() * SIZE) };
   |                                                 ^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type

error: found a count of bytes instead of a count of elements of `T`
  --> $DIR/functions.rs:38:41
   |
LL |     unsafe { from_raw_parts(y.as_ptr(), size_of::<u8>() * SIZE) };
   |                                         ^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type

error: found a count of bytes instead of a count of elements of `T`
  --> $DIR/functions.rs:40:33
   |
LL |     unsafe { y.as_mut_ptr().sub(size_of::<u8>()) };
   |                                 ^^^^^^^^^^^^^^^
   |
   = help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type

error: found a count of bytes instead of a count of elements of `T`
  --> $DIR/functions.rs:41:29
   |
LL |     y.as_ptr().wrapping_sub(size_of::<u8>());
   |                             ^^^^^^^^^^^^^^^
   |
   = help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type

error: found a count of bytes instead of a count of elements of `T`
  --> $DIR/functions.rs:42:29
   |
LL |     unsafe { y.as_ptr().add(size_of::<u8>()) };
   |                             ^^^^^^^^^^^^^^^
   |
   = help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type

error: found a count of bytes instead of a count of elements of `T`
  --> $DIR/functions.rs:43:33
   |
LL |     y.as_mut_ptr().wrapping_add(size_of::<u8>());
   |                                 ^^^^^^^^^^^^^^^
   |
   = help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type

error: found a count of bytes instead of a count of elements of `T`
  --> $DIR/functions.rs:44:32
   |
LL |     unsafe { y.as_ptr().offset(size_of::<u8>() as isize) };
   |                                ^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type

error: found a count of bytes instead of a count of elements of `T`
  --> $DIR/functions.rs:45:36
   |
LL |     y.as_mut_ptr().wrapping_offset(size_of::<u8>() as isize);
   |                                    ^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type

error: aborting due to 21 previous errors