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

Function test_try_leak_while_borrow_mut

tests/test_sharedref.rs:100–105  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

98
99#[test]
100fn test_try_leak_while_borrow_mut() {
101 let (gil, owner) = prepare_env();
102 let py = gil.python();
103 let _mut_ref = owner.string(py).borrow_mut();
104 assert!(owner.string(py).try_leak_immutable().is_err());
105}
106
107#[test]
108#[should_panic(expected = "already mutably borrowed")]

Callers

nothing calls this directly

Calls 3

prepare_envFunction · 0.85
pythonMethod · 0.80
borrow_mutMethod · 0.80

Tested by

no test coverage detected