This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit 83aad6b
authored
Rollup merge of rust-lang#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 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 @RalfJung1 file changed
+36
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
958 | 958 | | |
959 | 959 | | |
960 | 960 | | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
961 | 988 | | |
962 | 989 | | |
963 | 990 | | |
| |||
1272 | 1299 | | |
1273 | 1300 | | |
1274 | 1301 | | |
1275 | | - | |
1276 | | - | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
1277 | 1306 | | |
1278 | 1307 | | |
1279 | 1308 | | |
| |||
1387 | 1416 | | |
1388 | 1417 | | |
1389 | 1418 | | |
1390 | | - | |
1391 | | - | |
1392 | | - | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
1393 | 1424 | | |
1394 | 1425 | | |
1395 | 1426 | | |
| |||
0 commit comments