Incorrect '&'-reference removal #140166
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-macros
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
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
Rationale and extra context
The proposed change by the compiler is to remove the leading
&
-reference by removing the first character of the expression (which is not an&
in this case).I believe the
&
-reference in this case is from inside the lambda expression (the flat_map(|x| &x.into...) part).Other cases
Rust Version
Anything else?
No response
The text was updated successfully, but these errors were encountered: