Missing parentheses in invalid cast suggestion with multiple chained casts #89497
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.
Suggestions for invalid casts don't take precedence into account.
Ideally I think it should detect an attempted
*const T
to&T
and/or*mut T
to&mut T
cast and suggest replacing it with the dereferencing and reborrowing.Given the following code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=b31bf32a3d115ea22c88ef192e71ea4f
The current output is:
Ideally the output should look like:
The text was updated successfully, but these errors were encountered: