The compiler doesn't suggest borrowing dbg!(x)
#121795
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
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.
The above code returns this following error:
To solve this, you'd normally have to add a reference character like this:
But I think that Rust compiler should be able to understand what i'm trying to do without me having to manually add a reference on the variable
x
. I think this could be achieved by making an implementation that follows a similar logic as the following pseudocode:The text was updated successfully, but these errors were encountered: