Invalid suggestion from E0507 with & and ? #113547
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
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 suggestion for cloning the member that cannot be moved puts the
clone()
in the wrong place, but only (in this example) when combined with the question mark operator. Without the question mark&a.member
compiles with no errors.Playground: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=0a72b96edb6cf4f2fcab3e2cbf4c877e
Other cases
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: