Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6dbe78d

Browse files
committedAug 18, 2023
Updated the print-type-sizes async.rs test to opt into the new MIR
transformations added here (regardless of their default settings) and updated the numbers in the output to reflect the improvements those transformations yield.
1 parent 83e15f8 commit 6dbe78d

File tree

4 files changed

+70
-5
lines changed

4 files changed

+70
-5
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
print-type-size type: `[async fn body@$DIR/async.rs:14:36: 17:2]`: 16386 bytes, alignment: 1 bytes
2+
print-type-size discriminant: 1 bytes
3+
print-type-size variant `Unresumed`: 8192 bytes
4+
print-type-size upvar `.arg`: 8192 bytes
5+
print-type-size variant `Suspend0`: 16385 bytes
6+
print-type-size upvar `.arg`: 8192 bytes
7+
print-type-size local `.arg`: 8192 bytes
8+
print-type-size local `.__awaitee`: 1 bytes
9+
print-type-size variant `Returned`: 8192 bytes
10+
print-type-size upvar `.arg`: 8192 bytes
11+
print-type-size variant `Panicked`: 8192 bytes
12+
print-type-size upvar `.arg`: 8192 bytes
13+
print-type-size type: `std::mem::ManuallyDrop<[u8; 8192]>`: 8192 bytes, alignment: 1 bytes
14+
print-type-size field `.value`: 8192 bytes
15+
print-type-size type: `std::mem::MaybeUninit<[u8; 8192]>`: 8192 bytes, alignment: 1 bytes
16+
print-type-size variant `MaybeUninit`: 8192 bytes
17+
print-type-size field `.uninit`: 0 bytes
18+
print-type-size field `.value`: 8192 bytes
19+
print-type-size type: `[async fn body@$DIR/async.rs:12:17: 12:19]`: 1 bytes, alignment: 1 bytes
20+
print-type-size discriminant: 1 bytes
21+
print-type-size variant `Unresumed`: 0 bytes
22+
print-type-size variant `Returned`: 0 bytes
23+
print-type-size variant `Panicked`: 0 bytes
24+
print-type-size type: `std::mem::ManuallyDrop<[async fn body@$DIR/async.rs:12:17: 12:19]>`: 1 bytes, alignment: 1 bytes
25+
print-type-size field `.value`: 1 bytes
26+
print-type-size type: `std::mem::MaybeUninit<[async fn body@$DIR/async.rs:12:17: 12:19]>`: 1 bytes, alignment: 1 bytes
27+
print-type-size variant `MaybeUninit`: 1 bytes
28+
print-type-size field `.uninit`: 0 bytes
29+
print-type-size field `.value`: 1 bytes
30+
print-type-size type: `std::task::Poll<()>`: 1 bytes, alignment: 1 bytes
31+
print-type-size discriminant: 1 bytes
32+
print-type-size variant `Ready`: 0 bytes
33+
print-type-size field `.0`: 0 bytes
34+
print-type-size variant `Pending`: 0 bytes

‎tests/ui/print_type_sizes/async.stdout ‎tests/ui/print_type_sizes/async.both_on.stdout

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
print-type-size type: `[async fn body@$DIR/async.rs:10:36: 13:2]`: 8194 bytes, alignment: 1 bytes
1+
print-type-size type: `[async fn body@$DIR/async.rs:14:36: 17:2]`: 8194 bytes, alignment: 1 bytes
22
print-type-size discriminant: 1 bytes
33
print-type-size variant `Unresumed`: 8192 bytes
44
print-type-size upvar `.arg`: 8192 bytes
@@ -9,14 +9,14 @@ print-type-size variant `Returned`: 8192 bytes
99
print-type-size upvar `.arg`: 8192 bytes
1010
print-type-size variant `Panicked`: 8192 bytes
1111
print-type-size upvar `.arg`: 8192 bytes
12-
print-type-size type: `[async fn body@$DIR/async.rs:8:17: 8:19]`: 1 bytes, alignment: 1 bytes
12+
print-type-size type: `[async fn body@$DIR/async.rs:12:17: 12:19]`: 1 bytes, alignment: 1 bytes
1313
print-type-size discriminant: 1 bytes
1414
print-type-size variant `Unresumed`: 0 bytes
1515
print-type-size variant `Returned`: 0 bytes
1616
print-type-size variant `Panicked`: 0 bytes
17-
print-type-size type: `std::mem::ManuallyDrop<[async fn body@$DIR/async.rs:8:17: 8:19]>`: 1 bytes, alignment: 1 bytes
17+
print-type-size type: `std::mem::ManuallyDrop<[async fn body@$DIR/async.rs:12:17: 12:19]>`: 1 bytes, alignment: 1 bytes
1818
print-type-size field `.value`: 1 bytes
19-
print-type-size type: `std::mem::MaybeUninit<[async fn body@$DIR/async.rs:8:17: 8:19]>`: 1 bytes, alignment: 1 bytes
19+
print-type-size type: `std::mem::MaybeUninit<[async fn body@$DIR/async.rs:12:17: 12:19]>`: 1 bytes, alignment: 1 bytes
2020
print-type-size variant `MaybeUninit`: 1 bytes
2121
print-type-size field `.uninit`: 0 bytes
2222
print-type-size field `.value`: 1 bytes
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
print-type-size type: `[async fn body@$DIR/async.rs:14:36: 17:2]`: 8194 bytes, alignment: 1 bytes
2+
print-type-size discriminant: 1 bytes
3+
print-type-size variant `Unresumed`: 8192 bytes
4+
print-type-size upvar `.arg`: 8192 bytes
5+
print-type-size variant `Suspend0`: 8193 bytes
6+
print-type-size upvar `.arg`: 8192 bytes
7+
print-type-size local `.__awaitee`: 1 bytes
8+
print-type-size variant `Returned`: 8192 bytes
9+
print-type-size upvar `.arg`: 8192 bytes
10+
print-type-size variant `Panicked`: 8192 bytes
11+
print-type-size upvar `.arg`: 8192 bytes
12+
print-type-size type: `[async fn body@$DIR/async.rs:12:17: 12:19]`: 1 bytes, alignment: 1 bytes
13+
print-type-size discriminant: 1 bytes
14+
print-type-size variant `Unresumed`: 0 bytes
15+
print-type-size variant `Returned`: 0 bytes
16+
print-type-size variant `Panicked`: 0 bytes
17+
print-type-size type: `std::mem::ManuallyDrop<[async fn body@$DIR/async.rs:12:17: 12:19]>`: 1 bytes, alignment: 1 bytes
18+
print-type-size field `.value`: 1 bytes
19+
print-type-size type: `std::mem::MaybeUninit<[async fn body@$DIR/async.rs:12:17: 12:19]>`: 1 bytes, alignment: 1 bytes
20+
print-type-size variant `MaybeUninit`: 1 bytes
21+
print-type-size field `.uninit`: 0 bytes
22+
print-type-size field `.value`: 1 bytes
23+
print-type-size type: `std::task::Poll<()>`: 1 bytes, alignment: 1 bytes
24+
print-type-size discriminant: 1 bytes
25+
print-type-size variant `Ready`: 0 bytes
26+
print-type-size field `.0`: 0 bytes
27+
print-type-size variant `Pending`: 0 bytes

‎tests/ui/print_type_sizes/async.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
// compile-flags: -Z print-type-sizes --crate-type lib
1+
// revisions: both_off just_prop both_on
2+
// ignore-tidy-linelength
3+
// [both_off] compile-flags: -Z print-type-sizes --crate-type lib -Z mir-enable-passes=-UpvarToLocalProp,-InlineFutureIntoFuture
4+
// [just_prop] compile-flags: -Z print-type-sizes --crate-type lib -Z mir-enable-passes=+UpvarToLocalProp,-InlineFutureIntoFuture
5+
// [both_on] compile-flags: -Z print-type-sizes --crate-type lib -Z mir-enable-passes=+UpvarToLocalProp,+InlineFutureIntoFuture
26
// edition:2021
37
// build-pass
48
// ignore-pass

0 commit comments

Comments
 (0)
Please sign in to comment.