2 #![feature(arbitrary_self_types)]
9 unsafe fn foo(self: *const Self) -> *const str {
13 fn complicated_1(self: *const Rc
<Self>) -> &'
static str {
17 unsafe fn complicated_2(self: Rc
<*const Self>) -> *const str {
23 let foo
= Foo("abc123".into());
24 assert_eq
!("abc123", unsafe { &*(&foo as *const Foo).foo() }
);
25 assert_eq
!("Foo::complicated_1", std
::ptr
::null
::<Rc
<Foo
>>().complicated_1());
26 let rc
= Rc
::new(&foo
as *const Foo
);
27 assert_eq
!("abc123", unsafe { &*rc.complicated_2()}
);