-
Notifications
You must be signed in to change notification settings - Fork 88
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
Plan: Rust 2024 prelude #310
Comments
I'm currently thinking we should put the following traits forward for inclusion in the 2024 prelude:
This would mirror what we're including with |
Seems reasonable to me. I'm regularly surprised that A lot of code imports |
I don't believe so. They both point to the same trait, so with the way imports work this would Just Work I believe: playground. |
Playing devil's advocate for a bit, are Put another way, what capabilities do we enable by putting them in the prelude? (edit: accidentally said standard library instead of prelude in the first sentence. It's fixed now) |
If not in the standard library, then where would they be? |
They certainly need to be in the standard library to support
Yeah, but I would assume more people using them as impl traits in return or arg position, like I can see how |
Oh sorry, I misspoke! I meant to ask whether we need |
That's a good point. I wonder what the bar is for including things in the prelude is? I'd assume it's for things that essentially all Rust programs will use. Almost every program uses |
Yeah, we should talk to the libs team about criteria. Personally, I think we probably don't want to add anything - I reckon a minority of programs involves async code at all and a small minority of those write |
This is something we can validate by searching GitHub:
GitHub code search does have a few limitations. For one the search is not case-sensitive. And it also includes lines which are part of comments. But if we interpret this as a rough indicator rather than a precise measurement, it would seem that What I'm taking away from this is that the My goal with this comment was to specifically request input from the Async WG for which traits (or even types!) we may want to put forward for inclusion. Once we have a rough consensus among ourselves, I was planning to put it forward to the libs team as an ACP to formally clear the acceptance criteria with them. |
It's possible that once we have |
I get completely different numbers here and simply clicking these links gives me bogus results (e.g., results with "lang" and "rust" as the found text). I think that at least the repositories searched depends on the user. So I'm not sure these are reliable numbers. Given that GH search also counts forks as different repos, these are also going to be inaccurate that way too. I think a better count might be by downloading the source to the top 500 crates on crates.io and using grep? Or some similar exercise |
Oh it may be that you don't yet have access to the new code search feature. It's far more accurate than the previous search, and you can do things like |
|
As far as I know the prelude isn't expanded in between editions, so yeah I think we should talk about whether there are things that would make sense to put in the prelude every ~3 years. That seems like a pretty good cadence to have a conversation? To maybe look at this from a different angle: |
The 2024 prelude is now available behind a flag on nightly. We should consider PR'ing |
This is a roadmap item for wg-async. You can view the roadmap here: https://github.com/orgs/rust-lang/projects/28
The text was updated successfully, but these errors were encountered: