Description
Bevy version
0.9.0
[Optional] Relevant system information
I have rustc 1.64.0 on Ubuntu 20.04. Since I updated the Rust compiler a month or so ago, the first I heard about that no longer being the "latest stable release" was when Bevy failed to build while following the tutorial.
What you did
- Create a new project with
cargo init
- Add a Bevy dependency on 0.9.0 in Cargo.toml
- Run
cargo run
What went wrong
I got an error from the compiler (error[E0658]: `let...else` statements are unstable
) pointing to a usage of that construct in bevy_render_macros-0.9.0/src/as_bind_group.rs
.
The Rust compiler is usually quite good at hinting what to do about problems, but in this case it sent me to a closed Github issue.
The real answer is that this feature came out in rustc 1.65.0, which was released since I last updated Rust, is now the latest stable Rust, and is now what Bevy needs, Bevy presumably also having released since then, or at least allowed its dependencies to release and get pulled in.
But since the Rust developers don't personally notify me, @interfect, a hobbyist Rust programmer, every time they make a release, nor do I follow Rust with enough enthusiasm to check every few days to see if there's a new release, I didn't know I didn't have the latest stable Rust, so I tried to install Bevy anyway, and got confused.
(It looks like rustc might make new "stable" releases every month, which seems highly unusual for a language. It might be worth emphasizing that people in general will not already have the latest stable Rust in the Bevy documentation, unless they are actively starting new Rust projects more than once a month.)
Solution proposal
I think that Bevy should use the rust-version
field of Cargo.toml to articulate the version of Rust that was the latest stable version at the time of each Bevy release. This would allow Cargo to work out for me that Rust has released an update, instead of attempting to build Bevy with a Rust that everyone but me knows is too old for Bevy to work.
It would also be good to put the latest stable Rust at the time of writing into the tutorial, near the Bevy version that is recommended. It's all well and good to say "the latest stable" Rust, but my Rust has no idea whether it is the latest stable one or not, and it would be very helpful to have the actual version in there for when twenty years form now someone is trying to build an old game that only ever worked with Bevy 0.9.0.
The downside is that bumping these to change the Bevy version would also need to involve bumping them to plug in the then-current latest stable Rust release.