MCPcopy Index your code
hub / github.com/aiscriptdev/aiscript / erase

Method erase

aiscript-arena/src/types.rs:22–28  ·  view source on GitHub ↗
(ptr: NonNull<GcBoxInner<T>>)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

as_ptrMethod · 0.45

Tested by

no test coverage detected