File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,21 @@ pub struct AutoreleasePool {
2121 context : * mut c_void ,
2222}
2323
24+ /// ```rust,compile_fail
25+ /// use objc::rc::AutoreleasePool;
26+ /// fn needs_sync<T: Send>() {}
27+ /// needs_sync::<AutoreleasePool>();
28+ /// ```
29+ /// ```rust,compile_fail
30+ /// use objc::rc::AutoreleasePool;
31+ /// fn needs_send<T: Send>() {}
32+ /// needs_send::<AutoreleasePool>();
33+ /// ```
34+ #[ cfg( doctest) ]
35+ pub struct AutoreleasePoolNotSendNorSync ;
36+
2437impl AutoreleasePool {
25- /// Construct a new autoreleasepool .
38+ /// Construct a new autorelease pool .
2639 ///
2740 /// Use the [`autoreleasepool`] block for a safe alternative.
2841 ///
@@ -36,7 +49,7 @@ impl AutoreleasePool {
3649 #[ doc( alias = "objc_autoreleasePoolPush" ) ]
3750 unsafe fn new ( ) -> Self {
3851 // TODO: Make this function pub when we're more certain of the API
39- AutoreleasePool {
52+ Self {
4053 context : objc_autoreleasePoolPush ( ) ,
4154 }
4255 }
You can’t perform that action at this time.
0 commit comments