Skip to content

Commit 12cda6e

Browse files
committed
bless ui tests
1 parent a281f93 commit 12cda6e

File tree

4 files changed

+29
-26
lines changed

4 files changed

+29
-26
lines changed

tests/ui/async-await/async-drop.rs

+14-12
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,20 @@ fn main() {
5353
let i = 13;
5454
let fut = pin!(async {
5555
test_async_drop(Int(0), 0).await;
56-
test_async_drop(AsyncInt(0), 104).await;
57-
test_async_drop([AsyncInt(1), AsyncInt(2)], 152).await;
58-
test_async_drop((AsyncInt(3), AsyncInt(4)), 488).await;
56+
// FIXME(#63818): niches in coroutines are disabled.
57+
// Some of these sizes should be smaller, as indicated in comments.
58+
test_async_drop(AsyncInt(0), /*104*/ 112).await;
59+
test_async_drop([AsyncInt(1), AsyncInt(2)], /*152*/ 168).await;
60+
test_async_drop((AsyncInt(3), AsyncInt(4)), /*488*/ 528).await;
5961
test_async_drop(5, 0).await;
6062
let j = 42;
6163
test_async_drop(&i, 0).await;
6264
test_async_drop(&j, 0).await;
63-
test_async_drop(AsyncStruct { b: AsyncInt(8), a: AsyncInt(7), i: 6 }, 1688).await;
65+
test_async_drop(AsyncStruct { b: AsyncInt(8), a: AsyncInt(7), i: 6 }, /*1688*/ 1792).await;
6466
test_async_drop(ManuallyDrop::new(AsyncInt(9)), 0).await;
6567

6668
let foo = AsyncInt(10);
67-
test_async_drop(AsyncReference { foo: &foo }, 104).await;
69+
test_async_drop(AsyncReference { foo: &foo }, /*104*/ 112).await;
6870

6971
let foo = AsyncInt(11);
7072
test_async_drop(
@@ -73,17 +75,17 @@ fn main() {
7375
let foo = AsyncInt(10);
7476
foo
7577
},
76-
120,
78+
/*120*/ 136,
7779
)
7880
.await;
7981

80-
test_async_drop(AsyncEnum::A(AsyncInt(12)), 680).await;
81-
test_async_drop(AsyncEnum::B(SyncInt(13)), 680).await;
82+
test_async_drop(AsyncEnum::A(AsyncInt(12)), /*680*/ 736).await;
83+
test_async_drop(AsyncEnum::B(SyncInt(13)), /*680*/ 736).await;
8284

83-
test_async_drop(SyncInt(14), 16).await;
85+
test_async_drop(SyncInt(14), /*16*/ 24).await;
8486
test_async_drop(
8587
SyncThenAsync { i: 15, a: AsyncInt(16), b: SyncInt(17), c: AsyncInt(18) },
86-
3064,
88+
/*3064*/ 3296,
8789
)
8890
.await;
8991

@@ -99,11 +101,11 @@ fn main() {
99101
black_box(core::future::ready(())).await;
100102
foo
101103
},
102-
120,
104+
/*120*/ 136,
103105
)
104106
.await;
105107

106-
test_async_drop(AsyncUnion { signed: 21 }, 32).await;
108+
test_async_drop(AsyncUnion { signed: 21 }, /*32*/ 40).await;
107109
});
108110
let res = fut.poll(&mut cx);
109111
assert_eq!(res, Poll::Ready(()));

tests/ui/async-await/future-sizes/async-awaiting-fut.stdout

+9-11
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,26 @@ print-type-size field `.value`: 3077 bytes
1414
print-type-size type: `{async fn body of calls_fut<{async fn body of big_fut()}>()}`: 3077 bytes, alignment: 1 bytes
1515
print-type-size discriminant: 1 bytes
1616
print-type-size variant `Unresumed`: 1025 bytes
17-
print-type-size upvar `.fut`: 1025 bytes, offset: 0 bytes, alignment: 1 bytes
17+
print-type-size upvar `.fut`: 1025 bytes
1818
print-type-size variant `Suspend0`: 2052 bytes
19-
print-type-size upvar `.fut`: 1025 bytes, offset: 0 bytes, alignment: 1 bytes
20-
print-type-size padding: 1 bytes
21-
print-type-size local `.fut`: 1025 bytes, alignment: 1 bytes
19+
print-type-size upvar `.fut`: 1025 bytes
20+
print-type-size local `.fut`: 1025 bytes
2221
print-type-size local `..coroutine_field4`: 1 bytes, type: bool
2322
print-type-size local `.__awaitee`: 1 bytes, type: {async fn body of wait()}
2423
print-type-size variant `Suspend1`: 3076 bytes
25-
print-type-size upvar `.fut`: 1025 bytes, offset: 0 bytes, alignment: 1 bytes
26-
print-type-size padding: 1026 bytes
24+
print-type-size upvar `.fut`: 1025 bytes
25+
print-type-size padding: 1025 bytes
2726
print-type-size local `..coroutine_field4`: 1 bytes, alignment: 1 bytes, type: bool
2827
print-type-size local `.__awaitee`: 1025 bytes, type: {async fn body of big_fut()}
2928
print-type-size variant `Suspend2`: 2052 bytes
30-
print-type-size upvar `.fut`: 1025 bytes, offset: 0 bytes, alignment: 1 bytes
31-
print-type-size padding: 1 bytes
32-
print-type-size local `.fut`: 1025 bytes, alignment: 1 bytes
29+
print-type-size upvar `.fut`: 1025 bytes
30+
print-type-size local `.fut`: 1025 bytes
3331
print-type-size local `..coroutine_field4`: 1 bytes, type: bool
3432
print-type-size local `.__awaitee`: 1 bytes, type: {async fn body of wait()}
3533
print-type-size variant `Returned`: 1025 bytes
36-
print-type-size upvar `.fut`: 1025 bytes, offset: 0 bytes, alignment: 1 bytes
34+
print-type-size upvar `.fut`: 1025 bytes
3735
print-type-size variant `Panicked`: 1025 bytes
38-
print-type-size upvar `.fut`: 1025 bytes, offset: 0 bytes, alignment: 1 bytes
36+
print-type-size upvar `.fut`: 1025 bytes
3937
print-type-size type: `std::mem::ManuallyDrop<{async fn body of big_fut()}>`: 1025 bytes, alignment: 1 bytes
4038
print-type-size field `.value`: 1025 bytes
4139
print-type-size type: `std::mem::MaybeUninit<{async fn body of big_fut()}>`: 1025 bytes, alignment: 1 bytes

tests/ui/coroutine/discriminant.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,14 @@ fn main() {
124124
};
125125

126126
assert_eq!(size_of_val(&gen_u8_tiny_niche()), 1);
127-
assert_eq!(size_of_val(&Some(gen_u8_tiny_niche())), 1); // uses niche
127+
// FIXME(#63818): niches in coroutines are disabled.
128+
// assert_eq!(size_of_val(&Some(gen_u8_tiny_niche())), 1); // uses niche
128129
assert_eq!(size_of_val(&Some(Some(gen_u8_tiny_niche()))), 2); // cannot use niche anymore
129130
assert_eq!(size_of_val(&gen_u8_full()), 1);
130131
assert_eq!(size_of_val(&Some(gen_u8_full())), 2); // cannot use niche
131132
assert_eq!(size_of_val(&gen_u16()), 2);
132-
assert_eq!(size_of_val(&Some(gen_u16())), 2); // uses niche
133+
// FIXME(#63818): niches in coroutines are disabled.
134+
// assert_eq!(size_of_val(&Some(gen_u16())), 2); // uses niche
133135

134136
cycle(gen_u8_tiny_niche(), 254);
135137
cycle(gen_u8_full(), 255);

tests/ui/coroutine/niche-in-coroutine.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ fn main() {
1515
take(x);
1616
};
1717

18-
assert_eq!(size_of_val(&gen1), size_of_val(&Some(gen1)));
18+
// FIXME(#63818): niches in coroutines are disabled. Should be `assert_eq`.
19+
assert_ne!(size_of_val(&gen1), size_of_val(&Some(gen1)));
1920
}

0 commit comments

Comments
 (0)