E0596 error should suggest adding mut rather than a type signature #133939
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
Rationale and extra context
If you make rustc's first suggested change, you still get the same error, and if you make the second, you just end up with this error after:
Which wasn't really any help at all. With my alternative suggested change, you'll still get one more error, but that one will suggest changing
Some(x)
toSome(mut x)
, and that will make it work.Other cases
Rust Version
Tested on the Rust Playground with both stable 1.83.0 and 1.85.0-nightly 2024-12-04 acabb52 (sorry for the lack of the exact command you wanted, but see rust-lang/rust-playground#1043)
Anything else?
No response
The text was updated successfully, but these errors were encountered: