-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document traits from #[derive(...)] #44118
Comments
I think this'd make more sense if Rustdoc rendered impl-level documentation - There are two methods in |
Nit: Furthermore, I think this would need a slightly more complex syntax. Currently, /// doc 1
#[attr]
/// doc 2
item {} is the same as /// doc 1
/// doc 2
#[attr]
item {} (this is because Something like |
I am thinking a change of this magnitude requires an RFC, though I'm not sure. |
rust-lang/rfcs#1382 could cover this. |
One point that is important to me is, the docs should stay in the same file and near the `#[derive(X)]´ |
Moving here from rust-lang/cargo#4406 on @dns2utf8's behalf:
While documenting every public function of ThreadPool I had to implement
#[derive(Clone)
manually so I would be able to add an example.I assume
cargo doc
has a default template for the derive-able traits.So I propose something like this:
The template would have to include something like "yield" within the code it is generating.
In this case it should generate something equal to:
What do you think?
The text was updated successfully, but these errors were encountered: