This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit ea5e2f5
authored
Unrolled build for rust-lang#122922
Rollup merge of rust-lang#122922 - kpreid:print-async, r=compiler-errors
-Zprint-type-sizes: print the types of awaitees and unnamed coroutine locals.
This should assist comprehending the size of coroutines. In particular, whenever a future is suspended while awaiting another future, the latter is given the special name `__awaitee`, and now the type of the awaited future will be printed, allowing identifying caller/callee — er, I mean, poller/pollee — relationships.
It would be possible to include the type name in more cases, but I thought that that might be overly verbose (`print-type-sizes` is already a lot of text) and ordinary named fields or variables are easier for readers to discover the types of.
This change will also synergize with my other PR rust-lang#122923 which changes type printing to print the path of the `async fn` instead of the span.
Implementation note: I'm not sure if `Symbol::intern` is appropriate for this application, but it was the obvious way to not have to remove the `Copy` implementation from `FieldInfo`, or add a `'tcx` lifetime, while avoiding keeping a lot of possibly redundant strings in memory. I don't know what the proper tradeoff to make here is (though presumably it is not too important for a `-Z` debugging option).File tree
5 files changed
+34
-16
lines changed- compiler
- rustc_session/src
- rustc_ty_utils/src
- tests/ui
- async-await/future-sizes
- print_type_sizes
5 files changed
+34
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
| |||
192 | 196 | | |
193 | 197 | | |
194 | 198 | | |
195 | | - | |
| 199 | + | |
196 | 200 | | |
197 | 201 | | |
198 | 202 | | |
| |||
201 | 205 | | |
202 | 206 | | |
203 | 207 | | |
204 | | - | |
| 208 | + | |
205 | 209 | | |
206 | 210 | | |
207 | 211 | | |
208 | 212 | | |
209 | 213 | | |
210 | | - | |
| 214 | + | |
211 | 215 | | |
212 | 216 | | |
213 | | - | |
| 217 | + | |
214 | 218 | | |
215 | 219 | | |
216 | 220 | | |
217 | 221 | | |
218 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
219 | 229 | | |
220 | 230 | | |
221 | 231 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
1007 | 1008 | | |
1008 | 1009 | | |
1009 | 1010 | | |
| 1011 | + | |
1010 | 1012 | | |
1011 | 1013 | | |
1012 | 1014 | | |
| |||
1090 | 1092 | | |
1091 | 1093 | | |
1092 | 1094 | | |
| 1095 | + | |
1093 | 1096 | | |
1094 | 1097 | | |
1095 | 1098 | | |
| |||
1104 | 1107 | | |
1105 | 1108 | | |
1106 | 1109 | | |
| 1110 | + | |
1107 | 1111 | | |
1108 | 1112 | | |
1109 | 1113 | | |
1110 | 1114 | | |
1111 | 1115 | | |
1112 | 1116 | | |
1113 | | - | |
| 1117 | + | |
1114 | 1118 | | |
1115 | 1119 | | |
1116 | 1120 | | |
1117 | 1121 | | |
1118 | 1122 | | |
1119 | 1123 | | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
1120 | 1128 | | |
1121 | 1129 | | |
1122 | 1130 | | |
| |||
Lines changed: 7 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
| 22 | + | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
| 27 | + | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
| 33 | + | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
0 commit comments