Lines Matching refs:Rc
11 use crate::alloc::rc::Rc;
119 unsafe impl<T: ?Sized> PointerOps for DefaultPointerOps<Rc<T>> {
121 type Pointer = Rc<T>;
124 unsafe fn from_raw(&self, raw: *const T) -> Rc<T> { in from_raw()
125 Rc::from_raw(raw) in from_raw()
129 fn into_raw(&self, ptr: Rc<T>) -> *const T { in into_raw()
130 Rc::into_raw(ptr) in into_raw()
195 use std::rc::Rc;
215 let pointer_ops = DefaultPointerOps::<Rc<_>>::new(); in test_rc()
216 let p = Rc::new(1); in test_rc()
220 let p2: Rc<i32> = pointer_ops.from_raw(r); in test_rc()
260 let pointer_ops = DefaultPointerOps::<Rc<_>>::new(); in test_rc_unsized()
261 let p = Rc::new(1) as Rc<dyn Debug>; in test_rc_unsized()
267 let p2: Rc<dyn Debug> = pointer_ops.from_raw(r); in test_rc_unsized()
307 let pointer_ops = DefaultPointerOps::<Rc<_>>::new(); in clone_rc_from_raw()
308 let p = Rc::new(1); in clone_rc_from_raw()
310 let p2: Rc<i32> = clone_pointer_from_raw(&pointer_ops, raw); in clone_rc_from_raw()
311 assert_eq!(2, Rc::strong_count(&p2)); in clone_rc_from_raw()