File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,9 @@ pub struct Reference<'r> {
150150/// and explicitly. This is to have the fastest-possible default configuration available by default, but allow
151151/// those who experiment with workloads to get speed boosts of 2x or more.
152152///
153- /// Note: when built with `default-features = false`, this type is **not** `Send`.
153+ /// ### `Send` only with `parallel` feature
154+ ///
155+ /// When built with `default-features = false`, this type is **not** `Send`.
154156/// The minimal feature set to activate `Send` is `features = ["parallel"]`.
155157pub struct Repository {
156158 /// A ref store with shared ownership (or the equivalent of it).
@@ -186,8 +188,10 @@ pub struct Repository {
186188///
187189/// Note that it can also cheaply be cloned, and it will retain references to all contained resources.
188190///
189- /// Note: when built with `default-features = false`, this type is **not** `Send` or `Sync`.
190- /// The minimal feature set to activate `Send + Sync` is `features = ["parallel"]`.
191+ /// ### `Send` only with `parallel` feature
192+ ///
193+ /// When built with `default-features = false`, this type is **not** `Send`.
194+ /// The minimal feature set to activate `Send` is `features = ["parallel"]`.
191195#[ derive( Clone ) ]
192196pub struct ThreadSafeRepository {
193197 /// A store for references to point at objects
Original file line number Diff line number Diff line change @@ -138,3 +138,11 @@ fn thread_safe_repository_is_sync() -> crate::Result {
138138 f ( crate :: util:: basic_repo ( ) ?. into_sync ( ) ) ;
139139 Ok ( ( ) )
140140}
141+
142+ #[ test]
143+ #[ cfg( feature = "parallel" ) ]
144+ fn repository_is_send ( ) -> crate :: Result {
145+ fn f < T : Send + Clone > ( _t : T ) { }
146+ f ( crate :: util:: basic_repo ( ) ?) ;
147+ Ok ( ( ) )
148+ }
You can’t perform that action at this time.
0 commit comments