Cell::swap(&cell_t, &mut t) should suggest Cell::from_mut not Cell::replace(...) #128587
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
D-lack-of-suggestion
Diagnostics: Adding a (structured) suggestion would increase the quality of the diagnostic.
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 desired update is what the programmer intended to do:
Moreover, you can't move the
T
from behind the&mut T
, so the current help is not actionable.Motivating URLO topic.
Other cases
No response
Rust Version
Anything else?
This could be generalized to suggest
Cell::from_mut
wherever a&mut T
is passed and a&Cell<T>
would work.The text was updated successfully, but these errors were encountered: