diff --git a/gix/src/types.rs b/gix/src/types.rs index b9f8cced54f..4ada3d5c72d 100644 --- a/gix/src/types.rs +++ b/gix/src/types.rs @@ -149,6 +149,11 @@ pub struct Reference<'r> { /// Note that it clones itself so that it is empty, requiring the user to configure each clone separately, specifically /// and explicitly. This is to have the fastest-possible default configuration available by default, but allow /// those who experiment with workloads to get speed boosts of 2x or more. +/// +/// ### `Send` only with `parallel` feature +/// +/// When built with `default-features = false`, this type is **not** `Send`. +/// The minimal feature set to activate `Send` is `features = ["parallel"]`. pub struct Repository { /// A ref store with shared ownership (or the equivalent of it). pub refs: crate::RefStore, @@ -182,6 +187,11 @@ pub struct Repository { /// it's merely meant to be able to exist in a `Sync` context. /// /// Note that it can also cheaply be cloned, and it will retain references to all contained resources. +/// +/// ### `Send` only with `parallel` feature +/// +/// When built with `default-features = false`, this type is **not** `Send`. +/// The minimal feature set to activate `Send` is `features = ["parallel"]`. #[derive(Clone)] pub struct ThreadSafeRepository { /// A store for references to point at objects diff --git a/gix/tests/gix/repository/mod.rs b/gix/tests/gix/repository/mod.rs index 2909186ba6a..7a0c05fde67 100644 --- a/gix/tests/gix/repository/mod.rs +++ b/gix/tests/gix/repository/mod.rs @@ -138,3 +138,11 @@ fn thread_safe_repository_is_sync() -> crate::Result { f(crate::util::basic_repo()?.into_sync()); Ok(()) } + +#[test] +#[cfg(feature = "parallel")] +fn repository_is_send() -> crate::Result { + fn f(_t: T) {} + f(crate::util::basic_repo()?); + Ok(()) +}