-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trivial wrapper Generators waste space relative to wrapped Generators #114064
Comments
I think you are looking for #108590 and the issue linked in it |
yeah looks like the same issue |
7 tasks
Thanks for confirming :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm unclear if this is properly a bug or feature request - it's a missed optimization opportunity that IMO should be guaranteed.
I tried this code: (playground: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021)
I expected to see this happen: sizes of foo, bar, baz should all be identical, because foo and baz simply forward to the underlying foo - they don't have any additional states. This makes the generator abstraction less zero-cost than it should be.
Instead, this happened: sizes are 2, 3 and 4 respectively.
Meta
rustc 1.73.0-nightly (8771282 2023-07-23)
binary: rustc
commit-hash: 8771282
commit-date: 2023-07-23
host: x86_64-unknown-linux-gnu
release: 1.73.0-nightly
LLVM version: 16.0.5
The text was updated successfully, but these errors were encountered: