@@ -16,8 +16,8 @@ use core::task::{Context, Poll};
1616/// While this may seem not very useful, it allows `Exclusive` to _unconditionally_
1717/// implement `Sync`. Indeed, the safety requirements of `Sync` state that for `Exclusive`
1818/// 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.
2121///
2222/// Certain constructs like [`Future`]s can only be used with _exclusive_ access,
2323/// and are often `Send` but not `Sync`, so `Exclusive` can be used as hint to the
@@ -201,6 +201,17 @@ where
201201 }
202202}
203203
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_mut ( ) . call ( args)
212+ }
213+ }
214+
204215#[ unstable( feature = "exclusive_wrapper" , issue = "98407" ) ]
205216impl < T > Future for Exclusive < T >
206217where
0 commit comments