]> git.lizzy.rs Git - rust.git/blob - tests/ui/manual_bits.stderr
Add `usize` cast to `clippy::manual_bits` suggestion
[rust.git] / tests / ui / manual_bits.stderr
1 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
2   --> $DIR/manual_bits.rs:15:5
3    |
4 LL |     size_of::<i8>() * 8;
5    |     ^^^^^^^^^^^^^^^^^^^ help: consider using: `i8::BITS as usize`
6    |
7    = note: `-D clippy::manual-bits` implied by `-D warnings`
8
9 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
10   --> $DIR/manual_bits.rs:16:5
11    |
12 LL |     size_of::<i16>() * 8;
13    |     ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i16::BITS as usize`
14
15 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
16   --> $DIR/manual_bits.rs:17:5
17    |
18 LL |     size_of::<i32>() * 8;
19    |     ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i32::BITS as usize`
20
21 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
22   --> $DIR/manual_bits.rs:18:5
23    |
24 LL |     size_of::<i64>() * 8;
25    |     ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i64::BITS as usize`
26
27 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
28   --> $DIR/manual_bits.rs:19:5
29    |
30 LL |     size_of::<i128>() * 8;
31    |     ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `i128::BITS as usize`
32
33 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
34   --> $DIR/manual_bits.rs:20:5
35    |
36 LL |     size_of::<isize>() * 8;
37    |     ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `isize::BITS as usize`
38
39 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
40   --> $DIR/manual_bits.rs:22:5
41    |
42 LL |     size_of::<u8>() * 8;
43    |     ^^^^^^^^^^^^^^^^^^^ help: consider using: `u8::BITS as usize`
44
45 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
46   --> $DIR/manual_bits.rs:23:5
47    |
48 LL |     size_of::<u16>() * 8;
49    |     ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u16::BITS as usize`
50
51 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
52   --> $DIR/manual_bits.rs:24:5
53    |
54 LL |     size_of::<u32>() * 8;
55    |     ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u32::BITS as usize`
56
57 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
58   --> $DIR/manual_bits.rs:25:5
59    |
60 LL |     size_of::<u64>() * 8;
61    |     ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u64::BITS as usize`
62
63 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
64   --> $DIR/manual_bits.rs:26:5
65    |
66 LL |     size_of::<u128>() * 8;
67    |     ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `u128::BITS as usize`
68
69 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
70   --> $DIR/manual_bits.rs:27:5
71    |
72 LL |     size_of::<usize>() * 8;
73    |     ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `usize::BITS as usize`
74
75 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
76   --> $DIR/manual_bits.rs:29:5
77    |
78 LL |     8 * size_of::<i8>();
79    |     ^^^^^^^^^^^^^^^^^^^ help: consider using: `i8::BITS as usize`
80
81 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
82   --> $DIR/manual_bits.rs:30:5
83    |
84 LL |     8 * size_of::<i16>();
85    |     ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i16::BITS as usize`
86
87 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
88   --> $DIR/manual_bits.rs:31:5
89    |
90 LL |     8 * size_of::<i32>();
91    |     ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i32::BITS as usize`
92
93 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
94   --> $DIR/manual_bits.rs:32:5
95    |
96 LL |     8 * size_of::<i64>();
97    |     ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i64::BITS as usize`
98
99 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
100   --> $DIR/manual_bits.rs:33:5
101    |
102 LL |     8 * size_of::<i128>();
103    |     ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `i128::BITS as usize`
104
105 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
106   --> $DIR/manual_bits.rs:34:5
107    |
108 LL |     8 * size_of::<isize>();
109    |     ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `isize::BITS as usize`
110
111 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
112   --> $DIR/manual_bits.rs:36:5
113    |
114 LL |     8 * size_of::<u8>();
115    |     ^^^^^^^^^^^^^^^^^^^ help: consider using: `u8::BITS as usize`
116
117 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
118   --> $DIR/manual_bits.rs:37:5
119    |
120 LL |     8 * size_of::<u16>();
121    |     ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u16::BITS as usize`
122
123 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
124   --> $DIR/manual_bits.rs:38:5
125    |
126 LL |     8 * size_of::<u32>();
127    |     ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u32::BITS as usize`
128
129 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
130   --> $DIR/manual_bits.rs:39:5
131    |
132 LL |     8 * size_of::<u64>();
133    |     ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u64::BITS as usize`
134
135 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
136   --> $DIR/manual_bits.rs:40:5
137    |
138 LL |     8 * size_of::<u128>();
139    |     ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `u128::BITS as usize`
140
141 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
142   --> $DIR/manual_bits.rs:41:5
143    |
144 LL |     8 * size_of::<usize>();
145    |     ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `usize::BITS as usize`
146
147 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
148   --> $DIR/manual_bits.rs:51:5
149    |
150 LL |     size_of::<Word>() * 8;
151    |     ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `Word::BITS as usize`
152
153 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
154   --> $DIR/manual_bits.rs:55:18
155    |
156 LL |     let _: u32 = (size_of::<u128>() * 8) as u32;
157    |                  ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `u128::BITS`
158
159 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
160   --> $DIR/manual_bits.rs:56:18
161    |
162 LL |     let _: u32 = (size_of::<u128>() * 8).try_into().unwrap();
163    |                  ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `u128::BITS`
164
165 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
166   --> $DIR/manual_bits.rs:57:13
167    |
168 LL |     let _ = (size_of::<u128>() * 8).pow(5);
169    |             ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(u128::BITS as usize)`
170
171 error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
172   --> $DIR/manual_bits.rs:58:14
173    |
174 LL |     let _ = &(size_of::<u128>() * 8);
175    |              ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(u128::BITS as usize)`
176
177 error: aborting due to 29 previous errors
178