[][src]Macro checkers::with

macro_rules! with {
    ($f:expr) => { ... };
}

Run the given function inside of the allocation checker.

Thread-local checking will be enabled for the duration of the closure, then disabled and verified at the end of the closure.

Examples

#[test]
fn test_dealloc_layout() {
    checkers::with(|| {
       let mut bytes = Bytes::from(vec![10, 20, 30]);
       bytes.truncate(2);
    });
}