Can't modify value after temporarily dropping reference in loop when using Drop #92984
Labels
A-borrow-checker
Area: The borrow checker
A-MIR
Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
I expected to see this happen: Compile
Instead, this happened: Fails with error:
It works though if you remove the
Drop
impl forConsole
, or if you remove the loop. I would expect it to work withDrop
because the drop call happens beforegfx
is modified, and there shouldn't be any drop call immediately after it like the diagnostic suggests.Meta
rustc --version --verbose
:Tested in playground and in a local dev rustc (based on commit 1b3a5f2, from 3 weeks ago).
The text was updated successfully, but these errors were encountered: