#refcell #debugging #borrow #happen #error #standard #locations

debug-cell

A clone of the standard library’s RefCell type with extra debugging support in non-release builds. Whenever a borrow error happens the current locations of where known borrows were created will be printed out as well.

2 releases

Uses old Rust 2015

0.1.1 Mar 4, 2018
0.1.0 Aug 3, 2015

#8 in #happen

Download history 142/week @ 2023-11-27 132/week @ 2023-12-04 65/week @ 2023-12-11 139/week @ 2023-12-18 200/week @ 2023-12-25 56/week @ 2024-01-01 51/week @ 2024-01-08 64/week @ 2024-01-15 170/week @ 2024-01-22 94/week @ 2024-01-29 64/week @ 2024-02-05 74/week @ 2024-02-12 78/week @ 2024-02-19 70/week @ 2024-02-26 66/week @ 2024-03-04 183/week @ 2024-03-11

408 downloads per month
Used in 12 crates (2 directly)

MIT/Apache

12KB
235 lines

debug-cell

Build Status

Documentation

A clone of the standard library's RefCell type with extra debugging support in non-release builds. Whenever a borrow error happens the current locations of where known borrows were created will be printed out as well.

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Serde by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


lib.rs:

A clone of the standard library's RefCell type with extra debugging support in non-release builds.

Whenever a borrow error happens the current locations of where known borrows were created will be printed out as well.

Examples

use debug_cell::RefCell;

let r = RefCell::new(3);
let a = r.borrow();

// In debug builds this will print that the cell is currently borrowed
// above, and in release builds it will behave the same as the standard
// library's `RefCell`
let b = r.borrow_mut();

Dependencies

~2.4–3.5MB
~70K SLoC