reference
reference copied to clipboard
Expand `derive` documentation.
The derive attribute documentation should probably list the built-in traits that are derivable. To my knowledge, the list is:
CloneHashPartialEqEqPartialOrdOrdDebugDefault- ~~
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.
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.
Oops, I had just copy/pasted from the code and didn't pay attention.
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:
- the standard library
derivealso looks at fields and adds bounds forT::Assoc, but not<T as Trait>::Assochttps://github.com/lcnr/random-rust-snippets/issues/8 - to do this, it does not allow macro's in type position https://github.com/lcnr/random-rust-snippets/issues/9