Mutex giving dropped while still borrowed errors. #44801
Labels
A-borrow-checker
Area: The borrow checker
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.
With the following program:
I get the following compiler error:
However when I modify the program as follows:
The program compiles and runs as expected.
It seems odd to me that inserting
{}
after thelock
fixes the issue. It appears that any code following thelock
allows for the program to compile and run as expected, with an empty{}
or()
being the simplest way of doing this.The text was updated successfully, but these errors were encountered: