Mutating through Option::inspect
gives bogus suggestion
#128381
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
D-invalid-suggestion
Diagnostics: A structured suggestion resulting in incorrect code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
No response
Rationale and extra context
The compiler suggests to "consider changing this binding's type". But
Option::inspect
is outside my control, and it will give me a& &mut A
. There is nothing for me to change there.Here is a playground link: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=f54e1ae60f8e1a790c6a6379afe746fa
The code comes from a broken
clippy
suggestion which I also raised here: rust-lang/rust-clippy#13185Other cases
No response
Rust Version
Anything else?
No response
The text was updated successfully, but these errors were encountered: