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 @@ -18,6 +18,10 @@ mutably_borrowed: Cell, } +// &PySharedState can be Send because any mutation of inner cells is +// synchronized by the GIL. +unsafe impl Sync for PySharedState {} + impl PySharedState { pub fn borrow_mut<'a, T>( &'a self,