()
| 93 | impl GcBoxHeader { |
| 94 | #[inline(always)] |
| 95 | pub fn new<T: Collect>() -> Self { |
| 96 | // Helper trait to materialize vtables in static memory. |
| 97 | trait HasCollectVtable { |
| 98 | const VTABLE: CollectVtable; |
| 99 | } |
| 100 | |
| 101 | impl<T: Collect> HasCollectVtable for T { |
| 102 | const VTABLE: CollectVtable = CollectVtable::vtable_for::<T>(); |
| 103 | } |
| 104 | |
| 105 | let vtable: &'static _ = &<T as HasCollectVtable>::VTABLE; |
| 106 | Self { |
| 107 | next: Cell::new(None), |
| 108 | tagged_vtable: Cell::new(vtable as *const _), |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | /// Gets a reference to the `CollectVtable` used by this box. |
| 113 | #[inline(always)] |
nothing calls this directly
no outgoing calls
no test coverage detected