changeset 52792:3ea5bd40b8dc

rust-nodemap: requiring immutable part to be Sync This is necessary for the upcoming PyO3 bindings and does not bring any problems. In practical applications, this immutable part is often obtained by `mmap` and satisfies the requirement.
author Georges Racinet <georges.racinet@cloudcrane.io>
date Wed, 25 Dec 2024 12:43:45 +0100
parents 523ca3d225f5
children 42b219a1404a
files rust/hg-core/src/revlog/nodemap.rs
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-core/src/revlog/nodemap.rs	Tue Dec 24 18:56:32 2024 +0100
+++ b/rust/hg-core/src/revlog/nodemap.rs	Wed Dec 25 12:43:45 2024 +0100
@@ -330,7 +330,7 @@
     /// Retrieve added [`Block`]s and the original immutable data
     pub fn into_readonly_and_added(
         self,
-    ) -> (Box<dyn Deref<Target = [Block]> + Send>, Vec<Block>) {
+    ) -> (Box<dyn Deref<Target = [Block]> + Send + Sync>, Vec<Block>) {
         let mut vec = self.growable;
         let readonly = self.readonly;
         if readonly.last() != Some(&self.root) {
@@ -343,7 +343,7 @@
     /// storage
     pub fn into_readonly_and_added_bytes(
         self,
-    ) -> (Box<dyn Deref<Target = [Block]> + Send>, Vec<u8>) {
+    ) -> (Box<dyn Deref<Target = [Block]> + Send + Sync>, Vec<u8>) {
         let (readonly, vec) = self.into_readonly_and_added();
         // Prevent running `v`'s destructor so we are in complete control
         // of the allocation.