@@ -2,153 +2,177 @@ error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
2
2
--> $DIR/manual_bits.rs:9:5
3
3
|
4
4
LL | size_of::<i8>() * 8;
5
- | ^^^^^^^^^^^^^^^^^^^ help: consider using: `i8::BITS`
5
+ | ^^^^^^^^^^^^^^^^^^^ help: consider using: `i8::BITS as usize `
6
6
|
7
7
= note: `-D clippy::manual-bits` implied by `-D warnings`
8
8
9
9
error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
10
10
--> $DIR/manual_bits.rs:10:5
11
11
|
12
12
LL | size_of::<i16>() * 8;
13
- | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i16::BITS`
13
+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i16::BITS as usize `
14
14
15
15
error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
16
16
--> $DIR/manual_bits.rs:11:5
17
17
|
18
18
LL | size_of::<i32>() * 8;
19
- | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i32::BITS`
19
+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i32::BITS as usize `
20
20
21
21
error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
22
22
--> $DIR/manual_bits.rs:12:5
23
23
|
24
24
LL | size_of::<i64>() * 8;
25
- | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i64::BITS`
25
+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i64::BITS as usize `
26
26
27
27
error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
28
28
--> $DIR/manual_bits.rs:13:5
29
29
|
30
30
LL | size_of::<i128>() * 8;
31
- | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `i128::BITS`
31
+ | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `i128::BITS as usize `
32
32
33
33
error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
34
34
--> $DIR/manual_bits.rs:14:5
35
35
|
36
36
LL | size_of::<isize>() * 8;
37
- | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `isize::BITS`
37
+ | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `isize::BITS as usize `
38
38
39
39
error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
40
40
--> $DIR/manual_bits.rs:16:5
41
41
|
42
42
LL | size_of::<u8>() * 8;
43
- | ^^^^^^^^^^^^^^^^^^^ help: consider using: `u8::BITS`
43
+ | ^^^^^^^^^^^^^^^^^^^ help: consider using: `u8::BITS as usize `
44
44
45
45
error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
46
46
--> $DIR/manual_bits.rs:17:5
47
47
|
48
48
LL | size_of::<u16>() * 8;
49
- | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u16::BITS`
49
+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u16::BITS as usize `
50
50
51
51
error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
52
52
--> $DIR/manual_bits.rs:18:5
53
53
|
54
54
LL | size_of::<u32>() * 8;
55
- | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u32::BITS`
55
+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u32::BITS as usize `
56
56
57
57
error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
58
58
--> $DIR/manual_bits.rs:19:5
59
59
|
60
60
LL | size_of::<u64>() * 8;
61
- | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u64::BITS`
61
+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u64::BITS as usize `
62
62
63
63
error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
64
64
--> $DIR/manual_bits.rs:20:5
65
65
|
66
66
LL | size_of::<u128>() * 8;
67
- | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `u128::BITS`
67
+ | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `u128::BITS as usize `
68
68
69
69
error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
70
70
--> $DIR/manual_bits.rs:21:5
71
71
|
72
72
LL | size_of::<usize>() * 8;
73
- | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `usize::BITS`
73
+ | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `usize::BITS as usize `
74
74
75
75
error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
76
76
--> $DIR/manual_bits.rs:23:5
77
77
|
78
78
LL | 8 * size_of::<i8>();
79
- | ^^^^^^^^^^^^^^^^^^^ help: consider using: `i8::BITS`
79
+ | ^^^^^^^^^^^^^^^^^^^ help: consider using: `i8::BITS as usize `
80
80
81
81
error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
82
82
--> $DIR/manual_bits.rs:24:5
83
83
|
84
84
LL | 8 * size_of::<i16>();
85
- | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i16::BITS`
85
+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i16::BITS as usize `
86
86
87
87
error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
88
88
--> $DIR/manual_bits.rs:25:5
89
89
|
90
90
LL | 8 * size_of::<i32>();
91
- | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i32::BITS`
91
+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i32::BITS as usize `
92
92
93
93
error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
94
94
--> $DIR/manual_bits.rs:26:5
95
95
|
96
96
LL | 8 * size_of::<i64>();
97
- | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i64::BITS`
97
+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i64::BITS as usize `
98
98
99
99
error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
100
100
--> $DIR/manual_bits.rs:27:5
101
101
|
102
102
LL | 8 * size_of::<i128>();
103
- | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `i128::BITS`
103
+ | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `i128::BITS as usize `
104
104
105
105
error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
106
106
--> $DIR/manual_bits.rs:28:5
107
107
|
108
108
LL | 8 * size_of::<isize>();
109
- | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `isize::BITS`
109
+ | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `isize::BITS as usize `
110
110
111
111
error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
112
112
--> $DIR/manual_bits.rs:30:5
113
113
|
114
114
LL | 8 * size_of::<u8>();
115
- | ^^^^^^^^^^^^^^^^^^^ help: consider using: `u8::BITS`
115
+ | ^^^^^^^^^^^^^^^^^^^ help: consider using: `u8::BITS as usize `
116
116
117
117
error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
118
118
--> $DIR/manual_bits.rs:31:5
119
119
|
120
120
LL | 8 * size_of::<u16>();
121
- | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u16::BITS`
121
+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u16::BITS as usize `
122
122
123
123
error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
124
124
--> $DIR/manual_bits.rs:32:5
125
125
|
126
126
LL | 8 * size_of::<u32>();
127
- | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u32::BITS`
127
+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u32::BITS as usize `
128
128
129
129
error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
130
130
--> $DIR/manual_bits.rs:33:5
131
131
|
132
132
LL | 8 * size_of::<u64>();
133
- | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u64::BITS`
133
+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u64::BITS as usize `
134
134
135
135
error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
136
136
--> $DIR/manual_bits.rs:34:5
137
137
|
138
138
LL | 8 * size_of::<u128>();
139
- | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `u128::BITS`
139
+ | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `u128::BITS as usize `
140
140
141
141
error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
142
142
--> $DIR/manual_bits.rs:35:5
143
143
|
144
144
LL | 8 * size_of::<usize>();
145
- | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `usize::BITS`
145
+ | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `usize::BITS as usize `
146
146
147
147
error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
148
148
--> $DIR/manual_bits.rs:45:5
149
149
|
150
150
LL | size_of::<Word>() * 8;
151
- | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `Word::BITS`
151
+ | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `Word::BITS as usize `
152
152
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
154
178
0 commit comments