Gc::new_static allows for creating a Gc from any 'static type without bothering with a Collect impl. Uses the transparent StaticCollect wrapper internally to provide an empty Collect impl and casts the resulting pointer.
Gc::erase is simply a safe version of Gc::cast that casts to (), which we know is always safe.
As a drive-by change, also provides a for<'a> Rootable<'a> impl for StaticCollect, since it's easy to do and sometimes useful (there is an identical type in piccolo that exists only because the impl didn't exist on StaticCollect)
Adds
Gc::new_static
andGc::erase
.Gc::new_static
allows for creating a Gc from any 'static type without bothering with aCollect
impl. Uses the transparentStaticCollect
wrapper internally to provide an emptyCollect
impl and casts the resulting pointer.Gc::erase
is simply a safe version ofGc::cast
that casts to()
, which we know is always safe.As a drive-by change, also provides a
for<'a> Rootable<'a>
impl forStaticCollect
, since it's easy to do and sometimes useful (there is an identical type inpiccolo
that exists only because the impl didn't exist onStaticCollect
)