Rollup merge of #69528 - HeroicKatora:finalize-ref-cell, r=dtolnay
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 #68712 and uses the same tracking issue, #69099, as these methods deal with the same mechanism and the idea came up [in a review comment](https://github.com/rust-lang/rust/pull/68712#discussion_r384670041). @dtolnay who reviewed the prior PR. cc @RalfJung
Showing
想要评论请 注册 或 登录