rustc suggest adding "ref" before trait in derive attribute #122919
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
Rationale and extra context
I encountered the error while using the rust-dervie-builder crate. The above code is invalid as explained in this issue here: colin-kiegel/rust-derive-builder#298
Basically the expansion of this derive macro leads to
self
being referenced after a partial move.The first part of the error message is correct. The suggested fix however is just wrong.
For context, the expansion of the relevant code is the following
Other cases
No response
Rust Version
Anything else?
No response
The text was updated successfully, but these errors were encountered: