Borrow checker doesn't accept certain valid case when branch involves #57165
Labels
A-NLL
Area: Non-lexical lifetimes (NLL)
NLL-polonius
Issues related for using Polonius in the borrow checker
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The compiler currently rejects the following code:
It complains that
now
double mutably borrowsp.0
.This explanation is not very convincing. If you rewrite it this way:
the compile would happily accept it, and compiler certainly also accepts
so basically whatever the condition of
if
evaluates to, the original code should always be valid in terms of borrowing.I'm not sure if I'm missing something, but it seems to me this is a bug of the borrow checker?
The text was updated successfully, but these errors were encountered: