]> git.lizzy.rs Git - rust.git/commit
Add unborrow to reset RefCell borrow state
authorAndreas Molzer <andreas.molzer@gmx.de>
Thu, 27 Feb 2020 20:24:14 +0000 (21:24 +0100)
committerAndreas Molzer <andreas.molzer@gmx.de>
Wed, 4 Mar 2020 19:09:02 +0000 (20:09 +0100)
commit51b93966240acffdbe3fbb898bb647a03b146e09
tree3aee2221eabc28e3941797ff87083f491c46ce21
parent329022dfad7199053cbe225e8d7d13ebbd5eb230
Add unborrow to reset RefCell borrow state

This method is complementary for the feature refcell_leak added in an
earlier PR. It allows 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.
src/libcore/cell.rs