Incorrect non_shorthand_field_patterns warning #65924
Labels
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-bug
Category: This is a bug.
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.
This code gives incorrect warning:
The suggested fix makes
text
move, which is impossible sincefoo
is borrowed.Using auto borrowing with
match foo
instead ofmatch *foo
would make all fields borrowed, but I want most of them moved (copied).Link to playground
The text was updated successfully, but these errors were encountered: