Skip to content

Use --edition instead of -Zedition (stabilize edition flag, kind of) #49591

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

Closed
Manishearth opened this issue Apr 2, 2018 · 9 comments
Closed
Assignees
Labels
WG-epoch Working group: Epoch (2018) management

Comments

@Manishearth
Copy link
Member

Currently, Rust lets you specify the edition via -Zunstable-options -Zedition.

I'd like to stabilize the flag as --edition, such that non-nightly Rust can only pass down --edition=2015, but other versions can specify anything there.

@Manishearth Manishearth added the WG-epoch Working group: Epoch (2018) management label Apr 2, 2018
@Manishearth Manishearth self-assigned this Apr 2, 2018
@Manishearth
Copy link
Member Author

@klnusbaum want to work on this? I suspect this would have been better to do before rust-lang/cargo#5214 landed, but I kinda forgot, sorry 😄

You may want to factor it out such that Config or Session has an edition() method that returns the edition, so that code like sess.opts.debugging_options.edition doesn't need to exist.

I'd like this to exist in a week or two, so if you don't have the time lmk and I'll just land it.

@klnusbaum
Copy link
Contributor

Sure! I'd love to work on this. I'll try to take a wack at it sometime this week :)

@klnusbaum
Copy link
Contributor

What are the files that I should be looking at here? librustc/session/mod.rs and librustc/session/config.rs seem like the places I need to start, but the macros in config.rs are a little crazy. Where does the rubber meet the road, i.e. where's the code that says "these options should be mapped to these fields on a struct" or something like that?

@Manishearth
Copy link
Member Author

It uses getopts, I suspect you want to imitate what's done for the pretty option here.

The macros are for codegen/debugging options afaict, and we're moving this option out of there.

@Manishearth
Copy link
Member Author

@klnusbaum btw, you seem to be helping out a bunch with epoch/edition related stuff. You may want to join https://gitter.im/rust-lang/WG-epoch , and let me know if you want more interesting things to work on!

@klnusbaum
Copy link
Contributor

I'm starting to understand this a little more. Hoping to have something by the end of the weekend.

@klnusbaum
Copy link
Contributor

I think we can mark this as done. @Manishearth mentioned that cargo needs to be switched to now use --edition so I'll open another task in the cargo repo for that.

@klnusbaum
Copy link
Contributor

For reference, this was addressed with #50080

@Manishearth
Copy link
Member Author

Fixed by #50080

(For future reference, write "fixes #foo" in the PR body so it gets auto-closed. Or at least mention the issue so it gets cross linked)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WG-epoch Working group: Epoch (2018) management
Projects
None yet
Development

No branches or pull requests

2 participants