-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 support for Rust edition 2021. #8922
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Thanks for this! We'll probably want to hold off at least until the rustc PR is merged to avoid jumping the gun by accident, but one other question I have in the meantime is that we probably want this to be unstable until the edition is stabilized. Does rustc print an error if |
It should, yes! Current stable rustc:
'Stable' rustc with rust-lang/rust#79576:
|
Sounds great! r=me for when the corresponding rust-lang/rust PR is approved as well |
Add edition 2021. :fireworks: Happy new ~~year~~ edition. :champagne: This adds --edition=2021, and updates suggestions about 2018 to say "2018 *or later*". Related Cargo PR: rust-lang/cargo#8922 --- Edit: This adds the new edition as *unstable*. Without `-Z unstable-options`, `--edition=2021` results in: ``` $ rustc --edition=2021 error: edition 2021 is unstable and only available with -Z unstable-options. ```
Update: rust-lang/rust#79576 is approved, but waiting for the beta week to end. It should be merged 2021-01-01. |
Add edition 2021. :fireworks: Happy new ~~year~~ Rust. :champagne: This adds --edition=2021, and updates suggestions about 2018 to say "2018 *or later*". Related Cargo PR: rust-lang/cargo#8922 --- Edit: This adds the new edition as *unstable*. Without `-Z unstable-options`, `--edition=2021` results in: ``` $ rustc --edition=2021 error: edition 2021 is unstable and only available with -Z unstable-options. ```
rust-lang/rust#79576 has been merged. |
Great! Could this also update this line? Lines 699 to 709 in 5463132
(or better yet refactor it so that the compiler warns us via enum-usage that the line needs to get updated) Additionally do you know if lints are currently configured to enable this line yet -- Lines 648 to 650 in 5463132
|
Updated it to use the enum instead. Asking for an non-existent edition now gives an error instead of silently ignoring it like before. I changed the |
The situation with (Also, should |
Ok thanks for investigating! Seems like we should go ahead and land this and log the issues in a different location for handling later. Is there a central 2021 tracking issue we can log these bits on? Or should we create a new tracking issue in Cargo for these issues? FWIW I'd imagine that we should probably stop printing an error and instead if you I also think that we'll probably want |
Nope, but there's a hackmd in which we're trying to collect everything around the 2021 edition. Eventually it should all be tracked in proper github issues collected on the 2021 project board, so let's just open an issue on this repository to keep track of this. Edit: I've opened that issue, added it to the document and the project board. |
@bors: r+ 👍 that looks perfect to me, thanks! |
📌 Commit bc0c820 has been approved by |
⌛ Testing commit bc0c820 with merge e427d01b4fab3b004b42446e607861516f67a92e... |
💔 Test failed - checks-actions |
@bors: retry |
☀️ Test successful - checks-actions |
Update cargo 12 commits in 75d5d8cffe3464631f82dcd3c470b78dc1dda8bb..329895f5b52a358e5d9ecb26215708b5cb31d906 2020-12-22 18:10:56 +0000 to 2021-01-06 00:01:52 +0000 - metadata: Supply local path for path dependencies (rust-lang/cargo#8994) - Add support for Rust edition 2021. (rust-lang/cargo#8922) - Stabilize -Zfeatures and -Zpackage-features. (rust-lang/cargo#8997) - Small refactor, adding a list of all kinds to BuildContext (rust-lang/cargo#9046) - Fix git http.proxy config setting. (rust-lang/cargo#8986) - Clarify the help text of `--aggressive` and `--precise` of `update` (rust-lang/cargo#9031) - Assert that tests are run in the crate directory (rust-lang/cargo#9037) - Update mdbook (rust-lang/cargo#9044) - Bump to 0.52.0, update changelog (rust-lang/cargo#9042) - Fix redundant semicolon. (rust-lang/cargo#9033) - Clarify fingerprint log messages (rust-lang/cargo#9026) - Update credential docs for gnome-secret. (rust-lang/cargo#9013)
Update cargo 12 commits in 75d5d8cffe3464631f82dcd3c470b78dc1dda8bb..329895f5b52a358e5d9ecb26215708b5cb31d906 2020-12-22 18:10:56 +0000 to 2021-01-06 00:01:52 +0000 - metadata: Supply local path for path dependencies (rust-lang/cargo#8994) - Add support for Rust edition 2021. (rust-lang/cargo#8922) - Stabilize -Zfeatures and -Zpackage-features. (rust-lang/cargo#8997) - Small refactor, adding a list of all kinds to BuildContext (rust-lang/cargo#9046) - Fix git http.proxy config setting. (rust-lang/cargo#8986) - Clarify the help text of `--aggressive` and `--precise` of `update` (rust-lang/cargo#9031) - Assert that tests are run in the crate directory (rust-lang/cargo#9037) - Update mdbook (rust-lang/cargo#9044) - Bump to 0.52.0, update changelog (rust-lang/cargo#9042) - Fix redundant semicolon. (rust-lang/cargo#9033) - Clarify fingerprint log messages (rust-lang/cargo#9026) - Update credential docs for gnome-secret. (rust-lang/cargo#9013)
This adds support for
ediiton = "2021"
.Related
rustc
PR: rust-lang/rust#79576