x = yield;
makes generators larger than they need to be
#69672
Labels
A-async-await
Area: Async & Await
A-coroutines
Area: Coroutines
AsyncAwait-Triaged
Async-await issues that have been triaged during a working group meeting.
C-bug
Category: This is a bug.
F-coroutines
`#![feature(coroutines)]`
I-heavy
Issue: Problems and improvements with respect to binary size of generated code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
This generator has a size of 4 Bytes:
This one is 16 Bytes in size, even though it also does not need to keep
x
alive across theyield
:(where
makeit
is a fn returning ausize
, anduseit
is a fn taking&usize
)This seems to be fallout from #69302. Either the layout calculation soundness fix exposed it, or the visitor changes in there caused it.
This means that #69033 will increase the size of futures created from async fns, unless this bug is fixed.
The text was updated successfully, but these errors were encountered: