Confusing error when trying to re-borrow a function argument #75871
Labels
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.
It is a common mistake, especially for beginners, to attempt to reborrow function arguments when calling other functions.
I tried this code:
I expected to see this happen: Compile error following what the above code does if
foo(&x)
is attempted instead.Instead, this happened: Misleading error.
Meta
1.45.2 srable & 1.47.0 nightly on the playground
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=768e5a2d690393f89aed38be3fa5dee6
The text was updated successfully, but these errors were encountered: