mcarton / rust-derivative

A set of alternative `derive` attributes for Rust
Apache License 2.0
415 stars 46 forks source link

Derive Sync and Send #101

Open michalmoc opened 2 years ago

michalmoc commented 2 years ago

Send and sync are implemented by default only when all generic arguments are send/sync, which is not always necessary. To get them without bounds one needs to write

unsafe impl<T> Send for SomeType<T> {}
unsafe impl<T> Sync for SomeType<T> {}

for every such type. It would be more convenient to have #[derivative(Sync(bounds=""), Send(bounds=""))].

toyboot4e commented 2 years ago

Same applies to Default, though I don't mind the redundant (bounds = ""). Both default boundaries make sense.