diff --git a/rust/hg-cpython/src/ref_sharing.rs b/rust/hg-cpython/src/ref_sharing.rs --- a/rust/hg-cpython/src/ref_sharing.rs +++ b/rust/hg-cpython/src/ref_sharing.rs @@ -33,6 +33,10 @@ pub struct PySharedState { mutably_borrowed: Cell, } +// &PySharedState can be Send because any access to inner cells is +// synchronized by the GIL. +unsafe impl Sync for PySharedState {} + impl PySharedState { pub fn borrow_mut<'a, T>( &'a self,