cannot move out of borrowed content
error is bad when self is borrowed
#43161
Labels
A-borrow-checker
Area: The borrow checker
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
E.g., consider a struct with a field
build_queue
which is owned. In a&self
function I callrequest_build
which takesself
by value. I get the error:This is not very useful since it does not indicate why a move is happening and the squiggle is indicating the wrong thing. I think the squiggle should be under
self.build_queue
rather than justself
and that there should be a note referring to the definition ofrequest_build
and indicating the by-valueself
which causes the move.The text was updated successfully, but these errors were encountered: