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

Add an extended prelude for the 2018 editions #51434

Closed
wants to merge 2 commits into from

Conversation

Projects
None yet
8 participants
@SimonSapin
Copy link
Contributor

SimonSapin commented Jun 8, 2018

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?

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Jun 8, 2018

r? @withoutboats

(rust_highfive has picked a reviewer for you, use r? to override)

@SimonSapin SimonSapin force-pushed the SimonSapin:edition-prelude branch from f76c08b to eb51dfd Jun 8, 2018

@leodasvacas

This comment has been minimized.

Copy link
Contributor

leodasvacas commented Jun 8, 2018

Yay more prelude. But how will the decision be made for proposed extensions such as: Debug, Display, HashMap, HashSet, FromIterator.

@killercup

This comment has been minimized.

Copy link
Member

killercup commented Jun 8, 2018

I'm not sure if we rustfix can easily fix errors like carllerche/h2#251 to migrate us to the new prelude.

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 horrors edge cases we might run into.

@SimonSapin

This comment has been minimized.

Copy link
Contributor Author

SimonSapin commented Jun 9, 2018

@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…

@Manishearth

This comment has been minimized.

Copy link
Member

Manishearth commented Jun 12, 2018

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`?

This comment has been minimized.

@estebank

estebank Jun 12, 2018

Contributor

Just noticed this terrible suggestion. std::prelude::v1 is not an enum!

@pietroalbini

This comment has been minimized.

Copy link
Member

pietroalbini commented Jun 18, 2018

Ping from triage! What's the status on this?

@SimonSapin

This comment has been minimized.

Copy link
Contributor Author

SimonSapin commented Jun 18, 2018

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.

@SimonSapin

This comment has been minimized.

Copy link
Contributor Author

SimonSapin commented Jun 18, 2018

Closing for now to make triage easier. This is still tracked at #51418.

@SimonSapin SimonSapin closed this Jun 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.