@@ -26,7 +26,7 @@ macro_rules! check_sizes {
26
26
( check_one_specific_size: $ty: ty, $size: expr) => {
27
27
const _: Size :: <{ $size} > = Size :: <{ size_of:: <$ty>( ) } >;
28
28
} ;
29
- ( $ty: ty, $size: expr, $optioned_size: expr) => {
29
+ ( $ty: ty: $size: expr => $optioned_size: expr) => {
30
30
check_sizes!( check_one_specific_size: $ty, $size) ;
31
31
check_sizes!( check_one_specific_size: Option <$ty>, $optioned_size) ;
32
32
check_sizes!( check_no_niche_opt: $size != $optioned_size, $ty) ;
@@ -41,30 +41,30 @@ macro_rules! check_sizes {
41
41
42
42
const PTR_SIZE : usize = std:: mem:: size_of :: < * const ( ) > ( ) ;
43
43
44
- check_sizes ! ( Wrapper <u32 >, 4 , 8 ) ;
45
- check_sizes ! ( Wrapper <N32 >, 4 , 4 ) ; // (✓ niche opt)
46
- check_sizes ! ( Transparent <u32 >, 4 , 8 ) ;
47
- check_sizes ! ( Transparent <N32 >, 4 , 4 ) ; // (✓ niche opt)
48
- check_sizes ! ( NoNiche <u32 >, 4 , 8 ) ;
49
- check_sizes ! ( NoNiche <N32 >, 4 , 8 ) ;
44
+ check_sizes ! ( Wrapper <u32 >: 4 => 8 ) ;
45
+ check_sizes ! ( Wrapper <N32 >: 4 => 4 ) ; // (✓ niche opt)
46
+ check_sizes ! ( Transparent <u32 >: 4 => 8 ) ;
47
+ check_sizes ! ( Transparent <N32 >: 4 => 4 ) ; // (✓ niche opt)
48
+ check_sizes ! ( NoNiche <u32 >: 4 => 8 ) ;
49
+ check_sizes ! ( NoNiche <N32 >: 4 => 8 ) ;
50
50
51
- check_sizes ! ( UnsafeCell <u32 >, 4 , 8 ) ;
52
- check_sizes ! ( UnsafeCell <N32 >, 4 , 8 ) ;
51
+ check_sizes ! ( UnsafeCell <u32 >: 4 => 8 ) ;
52
+ check_sizes ! ( UnsafeCell <N32 >: 4 => 8 ) ;
53
53
54
- check_sizes ! ( UnsafeCell <& ( ) > , PTR_SIZE , PTR_SIZE * 2 ) ;
55
- check_sizes ! ( Cell <& ( ) > , PTR_SIZE , PTR_SIZE * 2 ) ;
56
- check_sizes ! ( RefCell <& ( ) > , PTR_SIZE * 2 , PTR_SIZE * 3 ) ;
54
+ check_sizes ! ( UnsafeCell <& ( ) >: PTR_SIZE => PTR_SIZE * 2 ) ;
55
+ check_sizes ! ( Cell <& ( ) >: PTR_SIZE => PTR_SIZE * 2 ) ;
56
+ check_sizes ! ( RefCell <& ( ) >: PTR_SIZE * 2 => PTR_SIZE * 3 ) ;
57
57
58
58
check_sizes ! ( RwLock <& ( ) >) ;
59
59
check_sizes ! ( Mutex <& ( ) >) ;
60
60
61
- check_sizes ! ( UnsafeCell <& [ i32 ] > , PTR_SIZE * 2 , PTR_SIZE * 3 ) ;
62
- check_sizes ! ( UnsafeCell <( & ( ) , & ( ) ) > , PTR_SIZE * 2 , PTR_SIZE * 3 ) ;
61
+ check_sizes ! ( UnsafeCell <& [ i32 ] >: PTR_SIZE * 2 => PTR_SIZE * 3 ) ;
62
+ check_sizes ! ( UnsafeCell <( & ( ) , & ( ) ) >: PTR_SIZE * 2 => PTR_SIZE * 3 ) ;
63
63
64
64
trait Trait { }
65
- check_sizes ! ( UnsafeCell <& dyn Trait > , PTR_SIZE * 2 , PTR_SIZE * 3 ) ;
65
+ check_sizes ! ( UnsafeCell <& dyn Trait >: PTR_SIZE * 2 => PTR_SIZE * 3 ) ;
66
66
67
67
#[ repr( simd) ]
68
68
pub struct Vec4 < T > ( [ T ; 4 ] ) ;
69
69
70
- check_sizes ! ( UnsafeCell <Vec4 <N32 >> , 16 , 32 ) ;
70
+ check_sizes ! ( UnsafeCell <Vec4 <N32 >>: 16 => 32 ) ;
0 commit comments