Avoid unimplementing auto traits on phantom struct
alecmocatta opened this issue · comments
Alec Mocatta commented
This line:
Line 48 in 1035d84
quote!(fn() -> #phantom)
to avoid unimplementing auto traits on the phantom struct and also affecting the drop check.
Phantom structs should probably always be Send
, Sync
and so on, I would have thought? But right now they only are if all covariant arguments also are.
David Tolnay commented
I think the current implementation is behaving correctly. The autotrait impls for core::marker::PhantomData
are also conditional.
https://doc.rust-lang.org/1.60.0/std/marker/struct.PhantomData.html#impl-Send