diff options
-rw-r--r-- | tests/expectations/tests/libclang-3.9/objc_inheritance.rs | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/tests/expectations/tests/libclang-3.9/objc_inheritance.rs b/tests/expectations/tests/libclang-3.9/objc_inheritance.rs index f2049a88..59cfacc3 100644 --- a/tests/expectations/tests/libclang-3.9/objc_inheritance.rs +++ b/tests/expectations/tests/libclang-3.9/objc_inheritance.rs @@ -43,7 +43,6 @@ impl Bar { } } impl IFoo for Bar {} - impl From<Bar> for Foo { fn from(child: Bar) -> Foo { Foo(child.0) @@ -62,6 +61,22 @@ impl std::convert::TryFrom<Foo> for Bar { } } impl IBar for Bar {} +pub trait IBar: Sized + std::ops::Deref {} +#[repr(transparent)] +#[derive(Clone)] +pub struct Baz(pub id); +impl std::ops::Deref for Baz { + type Target = objc::runtime::Object; + fn deref(&self) -> &Self::Target { + unsafe { &*self.0 } + } +} +unsafe impl objc::Message for Baz {} +impl Baz { + pub fn alloc() -> Self { + Self(unsafe { msg_send!(objc::class!(Baz), alloc) }) + } +} impl From<Baz> for Bar { fn from(child: Baz) -> Bar { Bar(child.0) @@ -97,21 +112,5 @@ impl std::convert::TryFrom<Foo> for Baz { } } } -pub trait IBar: Sized + std::ops::Deref {} -#[repr(transparent)] -#[derive(Clone)] -pub struct Baz(pub id); -impl std::ops::Deref for Baz { - type Target = objc::runtime::Object; - fn deref(&self) -> &Self::Target { - unsafe { &*self.0 } - } -} -unsafe impl objc::Message for Baz {} -impl Baz { - pub fn alloc() -> Self { - Self(unsafe { msg_send!(objc::class!(Baz), alloc) }) - } -} impl IBaz for Baz {} pub trait IBaz: Sized + std::ops::Deref {} |