@@ -16,8 +16,8 @@ use core::task::{Context, Poll};
16
16
/// While this may seem not very useful, it allows `Exclusive` to _unconditionally_
17
17
/// implement `Sync`. Indeed, the safety requirements of `Sync` state that for `Exclusive`
18
18
/// to be `Sync`, it must be sound to _share_ across threads, that is, it must be sound
19
- /// for `&Exclusive` to cross thread boundaries. By design, a `&Exclusive` has no API
20
- /// whatsoever, making it useless, thus harmless, thus memory safe.
19
+ /// for `&Exclusive` to cross thread boundaries. By design, a `&Exclusive<T>` for non-`Sync` T
20
+ /// has no API whatsoever, making it useless, thus harmless, thus memory safe.
21
21
///
22
22
/// Certain constructs like [`Future`]s can only be used with _exclusive_ access,
23
23
/// and are often `Send` but not `Sync`, so `Exclusive` can be used as hint to the
@@ -201,6 +201,17 @@ where
201
201
}
202
202
}
203
203
204
+ #[ unstable( feature = "exclusive_wrapper" , issue = "98407" ) ]
205
+ impl < F , Args > Fn < Args > for Exclusive < F >
206
+ where
207
+ F : Sync + Fn < Args > ,
208
+ Args : Tuple ,
209
+ {
210
+ extern "rust-call" fn call ( & self , args : Args ) -> Self :: Output {
211
+ self . as_ref ( ) . call ( args)
212
+ }
213
+ }
214
+
204
215
#[ unstable( feature = "exclusive_wrapper" , issue = "98407" ) ]
205
216
impl < T > Future for Exclusive < T >
206
217
where
0 commit comments