MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / test_leak_while_borrow_mut

Function test_leak_while_borrow_mut

tests/test_sharedref.rs:109–114  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

107#[test]
108#[should_panic(expected = "already mutably borrowed")]
109fn test_leak_while_borrow_mut() {
110 let (gil, owner) = prepare_env();
111 let py = gil.python();
112 let _mut_ref = owner.string(py).borrow_mut();
113 owner.string(py).leak_immutable();
114}
115
116#[test]
117fn test_try_borrow_mut_while_borrow() {

Callers

nothing calls this directly

Calls 4

prepare_envFunction · 0.85
pythonMethod · 0.80
borrow_mutMethod · 0.80
leak_immutableMethod · 0.80

Tested by

no test coverage detected