The existing Collect impls on reference types are sound, but they're a huge footgun because it's easy to accidentally call <&T as Collect>::trace instead of T::trace.
Just remove them and have an impl only for &'static T. Now, if you accidentally try to call <&T as Collect>::trace, you will at least get a compiler error instead of a silent footgun.
The existing
Collect
impls on reference types are sound, but they're a huge footgun because it's easy to accidentally call<&T as Collect>::trace
instead ofT::trace
.Just remove them and have an impl only for
&'static T
. Now, if you accidentally try to call<&T as Collect>::trace
, you will at least get a compiler error instead of a silent footgun.