-
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
Stabilize edition
key and add cargo new --edition
#5984
Conversation
b194f6d
to
e4c55e2
Compare
r? @matklad (rust_highfive has picked a reviewer for you, use r? to override) |
r? @ehuss |
Tweak (or drop?) the section in src/doc/src/reference/unstable.md? |
let manifest = fs::read_to_string(paths::root().join("foo/Cargo.toml")).unwrap(); | ||
assert!(manifest.contains("edition = \"2018\"")); | ||
} | ||
|
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.
A 'what is the default edition' test would be good too -- it should be 2018 I believe.
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.
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.
Yes agreed.
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.
From what I understand, the team discussed this and agreed not to do this early for nightly and just wait for another cycle
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.
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.
Looking at that document provides no clear rationale to me unless I missed it - the plan is that RC1 is a fully edition 2018 compatible compiler - and making that edition the default for new projects makes sense then.
Could someone from the cargo team perhaps clear up why we didn't want to change the default?
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.
The conclusion stemmed from being conservative. The compiler isn't ready right-the-red-hot-second for --edition 2018
to be the default because there's still unstable features (like the module system) which are in the process of stabilizing. As soon as the compiler is ready we'll change, and we conservatively said that "just before October 25 this must happen"
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.
@alexcrichton right but this PR is part of several ones in the queue that will stabilize all the pieces.
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.
Ok! It does indeed look like everything is in motion now. I'll make a PR to change the default after this one.
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.
I've submitted #5989 which switches to generating 2018 by default.
I also think we should land this now and upstream into rust-lang/rust, we can discuss and land the default change separately since it seems like we don't have consensus there. |
This commit stabilizes the `edition` key in `Cargo.toml`, both in the `[package]` section and inside subtargets. Additionally the `cargo new` and `cargo init` subcommands have been enhanced with a `--edition` flag to allow explicitly specifying the edition to be generated. This commit does not yet change the default edition that's generated. Closes rust-lang#5980
e4c55e2
to
3d02903
Compare
@dwijnand an excellent point! The docs should be updated now (and tests hopefully passing) |
@bors r+ |
📌 Commit 3d02903 has been approved by |
Stabilize `edition` key and add `cargo new --edition` This commit stabilizes the `edition` key in `Cargo.toml`, both in the `[package]` section and inside subtargets. Additionally the `cargo new` and `cargo init` subcommands have been enhanced with a `--edition` flag to allow explicitly specifying the edition to be generated. This commit does not yet change the default edition that's generated. Closes #5980
☀️ Test successful - status-appveyor, status-travis |
This commit stabilizes the
edition
key inCargo.toml
, both in the[package]
section and inside subtargets. Additionally thecargo new
andcargo init
subcommands have been enhanced with a--edition
flag to allowexplicitly specifying the edition to be generated.
This commit does not yet change the default edition that's generated.
Closes #5980