File tree 1 file changed +4
-5
lines changed
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -273,21 +273,20 @@ fn test_is_send_sync() {
273
273
274
274
#[ test]
275
275
fn test_compact_size ( ) {
276
- // Future rust will kill these drop flags!
277
- // 4 elements size + 1 len + 1 enum tag + [1 drop flag]
276
+ // 4 bytes + padding + length
278
277
type ByteArray = ArrayVec < u8 , 4 > ;
279
278
println ! ( "{}" , mem:: size_of:: <ByteArray >( ) ) ;
280
- assert ! ( mem:: size_of:: <ByteArray >( ) <= 8 ) ;
279
+ assert ! ( mem:: size_of:: <ByteArray >( ) <= 2 * mem :: size_of :: < usize > ( ) ) ;
281
280
282
281
// just length
283
282
type EmptyArray = ArrayVec < u8 , 0 > ;
284
283
println ! ( "{}" , mem:: size_of:: <EmptyArray >( ) ) ;
285
284
assert ! ( mem:: size_of:: <EmptyArray >( ) <= mem:: size_of:: <usize >( ) ) ;
286
285
287
- // 12 element size + 1 enum tag + 3 padding + 1 len + 1 drop flag + 2 padding
286
+ // 3 elements + padding + length
288
287
type QuadArray = ArrayVec < u32 , 3 > ;
289
288
println ! ( "{}" , mem:: size_of:: <QuadArray >( ) ) ;
290
- assert ! ( mem:: size_of:: <QuadArray >( ) <= 24 ) ;
289
+ assert ! ( mem:: size_of:: <QuadArray >( ) <= 4 * 4 + mem :: size_of :: < usize > ( ) ) ;
291
290
}
292
291
293
292
#[ test]
You can’t perform that action at this time.
0 commit comments