Skip to content

Rewrite box_region.rs to use generator resume arguments #68922

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
jonas-schievink opened this issue Feb 7, 2020 · 2 comments · Fixed by #71554
Closed

Rewrite box_region.rs to use generator resume arguments #68922

jonas-schievink opened this issue Feb 7, 2020 · 2 comments · Fixed by #71554
Labels
A-coroutines Area: Coroutines C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jonas-schievink
Copy link
Contributor

box_region.rs makes use of generators, and passes arguments into them via thread-local storage. Now that #68524 has landed, this can be rewritten to use generator resume arguments instead, which is much cleaner and possibly also faster.

@jonas-schievink jonas-schievink added C-cleanup Category: PRs that clean code up or issues documenting cleanup. I-compiletime Issue: Problems and improvements with respect to compile times. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-coroutines Area: Coroutines labels Feb 7, 2020
@bjorn3
Copy link
Member

bjorn3 commented Feb 7, 2020

I can't find any uses of box_region anymore: https://github.com/rust-lang/rust/search?q=box_region&unscoped_q=box_region

@jonas-schievink
Copy link
Contributor Author

src/librustc_interface/passes.rs uses it via the exported macros

@jonas-schievink jonas-schievink removed the I-compiletime Issue: Problems and improvements with respect to compile times. label Apr 5, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Apr 25, 2020
Replace thread_local with generator resume arguments in box_region.

Fixes rust-lang#68922.

Continuation of rust-lang#70622. Added a short doc, hope it makes sense.

r? @jonas-schievink
@bors bors closed this as completed in f70c9db Apr 26, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-coroutines Area: Coroutines C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
2 participants