Currently, #[collect(require_static)] can be used on an entire
struct/enum. This commit allows #[collect(require_static)] to be
applied to individual fields or field bindings of a struct/enum.
When applied, we generate a where-clause bound ensuring that the type of
the field binding outlives 'static. This allows us to ignore the field
in needs_trace and trace.
As a result, it's now possible to use #[derive(Collect)] on a
struct/enum containing foreign types, as long as those foreign types are
'static.
Currently,
#[collect(require_static)]
can be used on an entire struct/enum. This commit allows#[collect(require_static)]
to be applied to individual fields or field bindings of a struct/enum.When applied, we generate a where-clause bound ensuring that the type of the field binding outlives 'static. This allows us to ignore the field in
needs_trace
andtrace
.As a result, it's now possible to use
#[derive(Collect)]
on a struct/enum containing foreign types, as long as those foreign types are 'static.