Skip to content
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

Build fails with error[E0658]: let...else statements are unstable when the correct error message should be that rustc 1.65.0 is required #6777

Closed
interfect opened this issue Nov 27, 2022 · 4 comments
Labels
A-Meta About the project itself C-Docs An addition or correction to our documentation C-Usability A targeted quality-of-life change that makes Bevy easier to use

Comments

@interfect
Copy link

interfect commented Nov 27, 2022

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.

@interfect interfect added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Nov 27, 2022
@interfect interfect changed the title Build fails with error[E0658]: let...else statements are unstable when the correct error message should be that rustc 1.65.0 is required Build fails with ``error[E0658]: let...else statements are unstable`` when the correct error message should be that rustc 1.65.0 is required Nov 27, 2022
@interfect interfect changed the title Build fails with ``error[E0658]: let...else statements are unstable`` when the correct error message should be that rustc 1.65.0 is required Build fails with error[E0658]: let...else statements are unstable when the correct error message should be that rustc 1.65.0 is required Nov 27, 2022
@DasLixou
Copy link
Contributor

This is an error message from rust. i dont think bevy can do anything here. but when you read the README, you would know that the MSRV is the latest stable.

@alice-i-cecile alice-i-cecile added C-Docs An addition or correction to our documentation C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Meta About the project itself and removed C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Nov 27, 2022
@interfect
Copy link
Author

Yes. But knowing that the latest stable is the MSRV is insufficient to know whether I have the MSRV or not. If I update to Rust 1.65 now, There could be a 1.65.1 release at any moment after that, whereupon I would no longer have the MSRV anymore.

I want the build system to know whether or not I have the MSRV, and to complain at me specifically if I do not. Since I don't think Cargo.toml will let you say rust-version = latest-stable, that might involve some manual version bumping.

@alice-i-cecile
Copy link
Member

I think that setting the MSRV is probably the right call.

To do so, we need to add a CI job that automatically attempts to build Bevy under the MSRV.

@harudagondi
Copy link
Member

harudagondi commented Nov 27, 2022

interfect added a commit to interfect/bevy-website that referenced this issue Nov 27, 2022
This should help stop people from making mkistakes like
bevyengine/bevy#6777.

Novice Rust programmers might see "latest stable release" and think that that
measn "what I installed last month when I started learning Rust". However,
that's not likely to be the case.

Rust makes stable releases often enough that anyone who doesn't update it every
couple weeks or so actually needs to update Rust in order to use Bevy.

This should make theat clearer.
interfect added a commit to interfect/bevy-website that referenced this issue Nov 27, 2022
This should help stop people from making mkistakes like
bevyengine/bevy#6777.

Novice Rust programmers might see "latest stable release" and think that that
means "what I installed last month when I started learning Rust". However,
that's not likely to be the case.

Rust makes stable releases often enough that anyone who doesn't update it every
couple weeks or so actually needs to update Rust in order to use Bevy.

This should make that clearer.
interfect added a commit to interfect/bevy-website that referenced this issue Nov 27, 2022
This should help stop people from making mistakes like
bevyengine/bevy#6777.

Novice Rust programmers might see "latest stable release" and think that that
means "what I installed last month when I started learning Rust". However,
that's not likely to be the case.

Rust makes stable releases often enough that anyone who doesn't update it every
couple weeks or so actually needs to update Rust in order to use Bevy.

This should make that clearer.
@bors bors bot closed this as completed in 7df680b Jan 9, 2023
james7132 pushed a commit to james7132/bevy that referenced this issue Jan 21, 2023
# Objective

- Fixes bevyengine#6777, fixes bevyengine#2998, replaces bevyengine#5518
- Help avoid confusing error message when using an older version of Rust

## Solution

- Add the `rust-version` field to `Cargo.toml`
- Add a CI job checking the MSRV
- Add the job to bors
alradish pushed a commit to alradish/bevy that referenced this issue Jan 22, 2023
# Objective

- Fixes bevyengine#6777, fixes bevyengine#2998, replaces bevyengine#5518
- Help avoid confusing error message when using an older version of Rust

## Solution

- Add the `rust-version` field to `Cargo.toml`
- Add a CI job checking the MSRV
- Add the job to bors
ItsDoot pushed a commit to ItsDoot/bevy that referenced this issue Feb 1, 2023
# Objective

- Fixes bevyengine#6777, fixes bevyengine#2998, replaces bevyengine#5518
- Help avoid confusing error message when using an older version of Rust

## Solution

- Add the `rust-version` field to `Cargo.toml`
- Add a CI job checking the MSRV
- Add the job to bors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Meta About the project itself C-Docs An addition or correction to our documentation C-Usability A targeted quality-of-life change that makes Bevy easier to use
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants