(ptr: NonNull<GcBoxInner<T>>)
| 20 | /// in a `Box`. |
| 21 | #[inline(always)] |
| 22 | pub(crate) unsafe fn erase<T: ?Sized>(ptr: NonNull<GcBoxInner<T>>) -> Self { |
| 23 | unsafe { |
| 24 | // This cast is sound because `GcBoxInner` is `repr(C)`. |
| 25 | let erased = ptr.as_ptr() as *mut GcBoxInner<()>; |
| 26 | Self(NonNull::new_unchecked(erased)) |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | /// Gets a pointer to the value stored inside this box. |
| 31 | /// `T` must be the same type that was used with `erase`, so that |