Allow while let chains on all editions by est31 · Pull Request #140204 · rust-lang/rust (original) (raw)
If you're on an older edition, is there currently a clear error message if you try to use let chains, that tells you it's available in the Rust 2024 edition and newer?
The error message says that the feature is unstable. Which is suboptimal of course. The way that #132833 was implemented is that it removed the gating for let chains on newer editions, so the feature is still there and unstable. Back when I filed the PR, this was a necessity as the compiler hadn't been on 2024 yet (and it makes heavy use of let chains). Now that it is on 2024, it's a different situation.
Once clippy has updated their rustc to one with the stabilization, and we know precisely which syntax is restricted to newer editions (which is what this PR and #140198 are about), I think we can introduce a proper error like there is for async await, remove the feature gate, and mark the feature as stabilized. One might even be able to use the machinery added by #115677, not sure. It might not make it into 1.88.0 any more but I think that's not a big problem.