confusing error message from (object).method() with &mut self #4842
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-lifetimes
Area: Lifetimes / regions
A-type-system
Area: Type system
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
The compiler seems to consider
(a)
as an evaluation to a temporary value of the same type, which results in a quite confusing error. This doesn't occur withfunction((&mut x))
. @bstrie discovered this while removing mut fields.The text was updated successfully, but these errors were encountered: