RefCell::borrow in if let
expression is not dropped until after else
block
#113792
Labels
C-bug
Category: This is a bug.
I tried this code:
I expected to see this happen:
Instead, this happened:
IMHO, the borrowed value should go out of scope before the body of the
else
branch. Trying to bind the temporary to a variable fails when using it in theelse
branch:Note that the borrow checker is perfectly ok with the equivalent code not using a RefCell:
Meta
Also repro's on
1.73.0-nightly (2023-07-16 0e8e857b11f60a785aea)
rustc --version --verbose
:Backtrace
The text was updated successfully, but these errors were encountered: