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

Function test_borrow_while_borrow_mut

tests/test_sharedref.rs:143–148  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

141#[test]
142#[should_panic(expected = "already mutably borrowed")]
143fn test_borrow_while_borrow_mut() {
144 let (gil, owner) = prepare_env();
145 let py = gil.python();
146 let _mut_ref = owner.string(py).borrow_mut();
147 owner.string(py).borrow();
148}

Callers

nothing calls this directly

Calls 4

prepare_envFunction · 0.85
pythonMethod · 0.80
borrow_mutMethod · 0.80
borrowMethod · 0.80

Tested by

no test coverage detected