Skip to content
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

Document using liveness to infer auto traits for async blocks #1088

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

eholk
Copy link
Contributor

@eholk eholk commented Sep 7, 2021

In order to fix some of the issues around overly conservative generator captures (rust-lang/rust#69663), I am working on changing the analysis to be based on liveness of values rather than their scope. This is an update to the reference that describes how I propose things to work in the future, and I'd appreciate some feedback on it. Obviously we shouldn't merge this until the rustc changes are ready too, but I at least wanted to notify the lang team and get some feedback.

@eholk
Copy link
Contributor Author

eholk commented Sep 7, 2021

@rustbot label +I-nominate +T-lang

I'd appreciate some feedback. I'm also open to doing a video or chat meeting if that's helpful.

@rustbot
Copy link
Collaborator

rustbot commented Sep 7, 2021

Error: Label I-nominate can only be set by Rust team members

Please let @rust-lang/release know if you're having trouble with this bot.

@Mark-Simulacrum
Copy link
Member

Niko mentioned this in today's T-lang meeting and I raised that it'd be good to document the current state for this inference before adding changes, so that there's a good diff to look at.

@eholk
Copy link
Contributor Author

eholk commented Sep 29, 2021

@Mark-Simulacrum - That's a good idea, I'll put up a PR documenting the current rules and then rebase this one on top of that so that the differences are clearer.

We are in the process of changing this (rust-lang/#69663), but it
would be good to document the existing rules before changing them.
This should also help explain the compilation errors people are
getting in the meantime.
@eholk
Copy link
Contributor Author

eholk commented Sep 29, 2021

I just pushed #1093 which documents the current behavior. This PR now includes that one as well, so once we merge that one it will be easier to see what is changing.

This documents the proposed liveness-based rules for inferring auto
traits for async block. Currently we use a scope-based approach, so this
also serves as a description of we would like to change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-lang Team: Lang
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants