-
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
Add an extended prelude for the 2018 editions #51434
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
f76c08b
to
eb51dfd
Compare
Yay more prelude. But how will the decision be made for proposed extensions such as: |
I'm not sure if I think we can, in theory, write lint to the rust-2018-compatibility group that changes calls to methods that become ambiguous to their fully qualified form. But I'd rather hear from @Manishearth who has way more experience with this and can better judge the |
@leodasvacas I think that a decision for each of these needs to be made on a case-by-case basis, and not necessarily in this PR. @killercup I just checked https://rust-lang.github.io/rfcs/2052-epochs.html#a-broad-policy-on-epoch-changes and having rustfix automate the transition would be nice to have but per the RFC it is a requirement that code that would break warns in the previous edition. Unfortunately I don’t know how to go about implementing that warning… |
Lint feels a bit tricky to handle. Unsure what edge cases exist, though, so it might not be that tricky. |
@@ -42,6 +42,7 @@ error[E0573]: expected type, found variant `Ok` | |||
LL | fn foo() -> Ok { | |||
| ^^ not a type | |||
| | |||
= help: there is an enum variant `std::prelude::rust2018::Ok`, try using `std::prelude::rust2018`? | |||
= help: there is an enum variant `std::prelude::v1::Ok`, try using `std::prelude::v1`? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noticed this terrible suggestion. std::prelude::v1
is not an enum!
Ping from triage! What's the status on this? |
This is blocked on additional implementation work (a warning on 2015-edition code that would break in the 2018 edition) that I don’t know how to do… or deciding an exception for this “hard requirement” stated in the RFC. |
Closing for now to make triage easier. This is still tracked at #51418. |
As proposed in #51418.
Update: Per discussion below this PR also needs to add a warning for 2015 edition code that would break with the new prelude. Help wanted: any ideas how to make that happen?