Skip to content

Commit 24e8796

Browse files
committed
Use some more visible sigils than ,
1 parent 3338593 commit 24e8796

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/test/ui/layout/unsafe-cell-hides-niche.rs

+16-16
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ macro_rules! check_sizes {
2626
(check_one_specific_size: $ty:ty, $size:expr) => {
2727
const _: Size::<{$size}> = Size::<{size_of::<$ty>()}>;
2828
};
29-
($ty:ty, $size:expr, $optioned_size:expr) => {
29+
($ty:ty: $size:expr => $optioned_size:expr) => {
3030
check_sizes!(check_one_specific_size: $ty, $size);
3131
check_sizes!(check_one_specific_size: Option<$ty>, $optioned_size);
3232
check_sizes!(check_no_niche_opt: $size != $optioned_size, $ty);
@@ -41,30 +41,30 @@ macro_rules! check_sizes {
4141

4242
const PTR_SIZE: usize = std::mem::size_of::<*const ()>();
4343

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);
5050

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);
5353

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);
5757

5858
check_sizes!(RwLock<&()>);
5959
check_sizes!(Mutex<&()>);
6060

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);
6363

6464
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);
6666

6767
#[repr(simd)]
6868
pub struct Vec4<T>([T; 4]);
6969

70-
check_sizes!(UnsafeCell<Vec4<N32>> , 16, 32);
70+
check_sizes!(UnsafeCell<Vec4<N32>>: 16 => 32);

0 commit comments

Comments
 (0)