Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#69528 - HeroicKatora:finalize-ref-cell, r=d…
…tolnay Add undo_leak to reset RefCell borrow state This method is complementary for the feature cell_leak added in an earlier PR. It allows *safely* reverting the effects of leaking a borrow guard by statically proving that such a guard could not longer exist. This was not added to the existing `get_mut` out of concern of impacting the complexity of the otherwise pure pointer cast and because the name `get_mut` poorly communicates the intent of resetting remaining borrows. This is a follow-up to rust-lang#68712 and uses the same tracking issue, rust-lang#69099, as these methods deal with the same mechanism and the idea came up [in a review comment](rust-lang#68712 (comment)). @dtolnay who reviewed the prior PR. cc @RalfJung
- Loading branch information