@@ -2,153 +2,177 @@ error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
22 --> $DIR/manual_bits.rs:9:5
33 |
44LL | size_of::<i8>() * 8;
5- | ^^^^^^^^^^^^^^^^^^^ help: consider using: `i8::BITS`
5+ | ^^^^^^^^^^^^^^^^^^^ help: consider using: `i8::BITS as usize `
66 |
77 = note: `-D clippy::manual-bits` implied by `-D warnings`
88
99error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
1010 --> $DIR/manual_bits.rs:10:5
1111 |
1212LL | size_of::<i16>() * 8;
13- | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i16::BITS`
13+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i16::BITS as usize `
1414
1515error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
1616 --> $DIR/manual_bits.rs:11:5
1717 |
1818LL | size_of::<i32>() * 8;
19- | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i32::BITS`
19+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i32::BITS as usize `
2020
2121error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
2222 --> $DIR/manual_bits.rs:12:5
2323 |
2424LL | size_of::<i64>() * 8;
25- | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i64::BITS`
25+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i64::BITS as usize `
2626
2727error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
2828 --> $DIR/manual_bits.rs:13:5
2929 |
3030LL | size_of::<i128>() * 8;
31- | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `i128::BITS`
31+ | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `i128::BITS as usize `
3232
3333error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
3434 --> $DIR/manual_bits.rs:14:5
3535 |
3636LL | size_of::<isize>() * 8;
37- | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `isize::BITS`
37+ | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `isize::BITS as usize `
3838
3939error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
4040 --> $DIR/manual_bits.rs:16:5
4141 |
4242LL | size_of::<u8>() * 8;
43- | ^^^^^^^^^^^^^^^^^^^ help: consider using: `u8::BITS`
43+ | ^^^^^^^^^^^^^^^^^^^ help: consider using: `u8::BITS as usize `
4444
4545error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
4646 --> $DIR/manual_bits.rs:17:5
4747 |
4848LL | size_of::<u16>() * 8;
49- | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u16::BITS`
49+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u16::BITS as usize `
5050
5151error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
5252 --> $DIR/manual_bits.rs:18:5
5353 |
5454LL | size_of::<u32>() * 8;
55- | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u32::BITS`
55+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u32::BITS as usize `
5656
5757error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
5858 --> $DIR/manual_bits.rs:19:5
5959 |
6060LL | size_of::<u64>() * 8;
61- | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u64::BITS`
61+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u64::BITS as usize `
6262
6363error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
6464 --> $DIR/manual_bits.rs:20:5
6565 |
6666LL | size_of::<u128>() * 8;
67- | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `u128::BITS`
67+ | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `u128::BITS as usize `
6868
6969error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
7070 --> $DIR/manual_bits.rs:21:5
7171 |
7272LL | size_of::<usize>() * 8;
73- | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `usize::BITS`
73+ | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `usize::BITS as usize `
7474
7575error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
7676 --> $DIR/manual_bits.rs:23:5
7777 |
7878LL | 8 * size_of::<i8>();
79- | ^^^^^^^^^^^^^^^^^^^ help: consider using: `i8::BITS`
79+ | ^^^^^^^^^^^^^^^^^^^ help: consider using: `i8::BITS as usize `
8080
8181error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
8282 --> $DIR/manual_bits.rs:24:5
8383 |
8484LL | 8 * size_of::<i16>();
85- | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i16::BITS`
85+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i16::BITS as usize `
8686
8787error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
8888 --> $DIR/manual_bits.rs:25:5
8989 |
9090LL | 8 * size_of::<i32>();
91- | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i32::BITS`
91+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i32::BITS as usize `
9292
9393error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
9494 --> $DIR/manual_bits.rs:26:5
9595 |
9696LL | 8 * size_of::<i64>();
97- | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i64::BITS`
97+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i64::BITS as usize `
9898
9999error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
100100 --> $DIR/manual_bits.rs:27:5
101101 |
102102LL | 8 * size_of::<i128>();
103- | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `i128::BITS`
103+ | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `i128::BITS as usize `
104104
105105error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
106106 --> $DIR/manual_bits.rs:28:5
107107 |
108108LL | 8 * size_of::<isize>();
109- | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `isize::BITS`
109+ | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `isize::BITS as usize `
110110
111111error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
112112 --> $DIR/manual_bits.rs:30:5
113113 |
114114LL | 8 * size_of::<u8>();
115- | ^^^^^^^^^^^^^^^^^^^ help: consider using: `u8::BITS`
115+ | ^^^^^^^^^^^^^^^^^^^ help: consider using: `u8::BITS as usize `
116116
117117error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
118118 --> $DIR/manual_bits.rs:31:5
119119 |
120120LL | 8 * size_of::<u16>();
121- | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u16::BITS`
121+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u16::BITS as usize `
122122
123123error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
124124 --> $DIR/manual_bits.rs:32:5
125125 |
126126LL | 8 * size_of::<u32>();
127- | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u32::BITS`
127+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u32::BITS as usize `
128128
129129error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
130130 --> $DIR/manual_bits.rs:33:5
131131 |
132132LL | 8 * size_of::<u64>();
133- | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u64::BITS`
133+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u64::BITS as usize `
134134
135135error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
136136 --> $DIR/manual_bits.rs:34:5
137137 |
138138LL | 8 * size_of::<u128>();
139- | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `u128::BITS`
139+ | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `u128::BITS as usize `
140140
141141error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
142142 --> $DIR/manual_bits.rs:35:5
143143 |
144144LL | 8 * size_of::<usize>();
145- | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `usize::BITS`
145+ | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `usize::BITS as usize `
146146
147147error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
148148 --> $DIR/manual_bits.rs:45:5
149149 |
150150LL | size_of::<Word>() * 8;
151- | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `Word::BITS`
151+ | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `Word::BITS as usize `
152152
153- error: aborting due to 25 previous errors
153+ error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
154+ --> $DIR/manual_bits.rs:49: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:50: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:51: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:52: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
154178
0 commit comments