Using 2015 edition by accident gives a very unpleasant experience to users, because code examples they copy fail to compile, tripping up on subtle differences in module paths and extern crates. For example:
a user has started a project using an innocent-looking template:
[package] name = "hello-world-warp" version = "0.1.0" [dependencies] warp = "0.1.18"
and got a super-confusing compile error with no hint of what is the real cause of failure.
I'm afraid that edition 2015 being the silent default, is going to haunt users forever, like the undead Quirks Mode of HTML.
Can this be helped?
For example, Cargo could warn if the
edition key is missing in
Cargo.toml, and there's no explicit opt-in from the user into the 2015 edition.
For recent compilers silencing this warning could be as easy as setting
edition = "2015" in
Cargo.toml. The only downside is for projects that insist supporting old Rust versions, including the few that recognize the
edition key as unstable, and refuse to work.
So the "stop warning about 2015 edition" opt-in could be a flag in
~/.cargo/config instead, or a comment in
Cargo.toml, or some key in
metadata, or a command-line flag or something else.