You did need to add #[rustc_specialization_trait]
to Clone
, Send
and Sync
for rustc to accept that code. Note that adding #[rustc_specialization_trait]
to a trait is an promise (the same way that an unsafe block is a promise) that you will not implement the trait for any type unless the implementation covers all possible lifetimes. Empirically there are implementations that violate these requirements in the ecosystem and as they are not unsafe even if there weren't yet someone could add one and as such the standard library can't mark these traits as #[rustc_specialization_trait]
without enabling UB in any crate that specializes on those traits.
1 Like