Skip to content

Commit ee996f2

Browse files
committed
Relax a few more Sized bounds
1 parent 3eb3a6b commit ee996f2

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

objc2/src/declare.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ use crate::{ffi, Encode, EncodeArguments, Encoding, Message};
4545
/// Types that can be used as the implementation of an Objective-C method.
4646
pub trait MethodImplementation {
4747
/// The callee type of the method.
48-
type Callee: Message;
48+
type Callee: Message + ?Sized;
4949
/// The return type of the method.
5050
type Ret: Encode;
5151
/// The argument types of the method.
@@ -59,7 +59,7 @@ macro_rules! method_decl_impl {
5959
(-$s:ident, $r:ident, $f:ty, $($t:ident),*) => (
6060
impl<$s, $r, $($t),*> MethodImplementation for $f
6161
where
62-
$s: Message,
62+
$s: Message + ?Sized,
6363
$r: Encode,
6464
$($t: Encode,)*
6565
{

objc2/src/rc/autorelease.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ auto_trait! {
202202
}
203203

204204
#[cfg(not(feature = "unstable_autoreleasesafe"))]
205-
unsafe impl<T> AutoreleaseSafe for T {}
205+
unsafe impl<T: ?Sized> AutoreleaseSafe for T {}
206206

207207
#[cfg(feature = "unstable_autoreleasesafe")]
208208
impl !AutoreleaseSafe for AutoreleasePool {}

objc2/src/runtime.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -580,17 +580,17 @@ impl Object {
580580

581581
/// ```
582582
/// use objc2::runtime::Object;
583-
/// fn needs_nothing<T>() {}
583+
/// fn needs_nothing<T: ?Sized>() {}
584584
/// needs_nothing::<Object>();
585585
/// ```
586586
/// ```compile_fail
587587
/// use objc2::runtime::Object;
588-
/// fn needs_sync<T: Sync>() {}
588+
/// fn needs_sync<T: ?Sized + Sync>() {}
589589
/// needs_sync::<Object>();
590590
/// ```
591591
/// ```compile_fail
592592
/// use objc2::runtime::Object;
593-
/// fn needs_send<T: Send>() {}
593+
/// fn needs_send<T: ?Sized + Send>() {}
594594
/// needs_send::<Object>();
595595
/// ```
596596
#[cfg(doctest)]
@@ -734,7 +734,7 @@ mod tests {
734734

735735
#[test]
736736
fn test_send_sync() {
737-
fn assert_send_sync<T: Send + Sync>() {}
737+
fn assert_send_sync<T: Send + Sync + ?Sized>() {}
738738
assert_send_sync::<Bool>();
739739
assert_send_sync::<Class>();
740740
assert_send_sync::<Ivar>();

0 commit comments

Comments
 (0)