Open ehuss opened 5 years ago
Send and Sync to my knowledge can't be derived -- they're auto-implemented by the compiler where applicable and are otherwise unsafe
to implement.
Should the documentation also specify the semantics of how the default implementations behave? It seems like important information, but I think it is mostly covered in the core/std docs.
Yes, the reference should strive to be the source of truth to which everything links, not the other way around. (caveat for things about rustc and notes...) The info should be here.
We should also document:
derive
also looks at fields and adds bounds for T::Assoc
, but not <T as Trait>::Assoc
https://github.com/lcnr/random-rust-snippets/issues/8
The
derive
attribute documentation should probably list the built-in traits that are derivable. To my knowledge, the list is:Clone
Hash
PartialEq
Eq
PartialOrd
Ord
Debug
Default
Send
Sync
Copy
Should the documentation also specify the semantics of how the default implementations behave? It seems like important information, but I think it is mostly covered in the core/std docs. Another option is to link to https://doc.rust-lang.org/book/appendix-03-derivable-traits.html.