diff rust/hg-cpython/src/exceptions.rs @ 44206:9804badd5970

rust-cpython: make PySharedRef::try_borrow_mut() return BorrowMutError As I said, it shouldn't be an error of Python layer, but is something like a coding error. Returning BorrowMutError makes more sense. There's a weird hack to propagate the borrow-by-leaked state to RefCell to obtain BorrowMutError. If we don't like it, maybe we can add our own BorrowMutError.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 19 Oct 2019 17:01:28 +0900
parents 3bd77c64bc74
children f96b28aa4b79
line wrap: on
line diff
--- a/rust/hg-cpython/src/exceptions.rs	Sat Oct 19 16:48:34 2019 +0900
+++ b/rust/hg-cpython/src/exceptions.rs	Sat Oct 19 17:01:28 2019 +0900
@@ -40,5 +40,3 @@
 }
 
 py_exception!(rustext, HgPathPyError, RuntimeError);
-
-py_exception!(shared_ref, AlreadyBorrowed, RuntimeError);