diff --git a/objc2/src/declare.rs b/objc2/src/declare.rs index 691d5b197..9bdb02f3a 100644 --- a/objc2/src/declare.rs +++ b/objc2/src/declare.rs @@ -45,7 +45,7 @@ use crate::{ffi, Encode, EncodeArguments, Encoding, Message}; /// Types that can be used as the implementation of an Objective-C method. pub trait MethodImplementation { /// The callee type of the method. - type Callee: Message; + type Callee: Message + ?Sized; /// The return type of the method. type Ret: Encode; /// The argument types of the method. @@ -59,7 +59,7 @@ macro_rules! method_decl_impl { (-$s:ident, $r:ident, $f:ty, $($t:ident),*) => ( impl<$s, $r, $($t),*> MethodImplementation for $f where - $s: Message, + $s: Message + ?Sized, $r: Encode, $($t: Encode,)* { diff --git a/objc2/src/rc/autorelease.rs b/objc2/src/rc/autorelease.rs index 8e5b99493..f22e3bc5e 100644 --- a/objc2/src/rc/autorelease.rs +++ b/objc2/src/rc/autorelease.rs @@ -202,7 +202,7 @@ auto_trait! { } #[cfg(not(feature = "unstable_autoreleasesafe"))] -unsafe impl AutoreleaseSafe for T {} +unsafe impl AutoreleaseSafe for T {} #[cfg(feature = "unstable_autoreleasesafe")] impl !AutoreleaseSafe for AutoreleasePool {} diff --git a/objc2/src/runtime.rs b/objc2/src/runtime.rs index cf339069d..3a3e388d9 100644 --- a/objc2/src/runtime.rs +++ b/objc2/src/runtime.rs @@ -580,17 +580,17 @@ impl Object { /// ``` /// use objc2::runtime::Object; -/// fn needs_nothing() {} +/// fn needs_nothing() {} /// needs_nothing::(); /// ``` /// ```compile_fail /// use objc2::runtime::Object; -/// fn needs_sync() {} +/// fn needs_sync() {} /// needs_sync::(); /// ``` /// ```compile_fail /// use objc2::runtime::Object; -/// fn needs_send() {} +/// fn needs_send() {} /// needs_send::(); /// ``` #[cfg(doctest)] @@ -734,7 +734,7 @@ mod tests { #[test] fn test_send_sync() { - fn assert_send_sync() {} + fn assert_send_sync() {} assert_send_sync::(); assert_send_sync::(); assert_send_sync::();