Uh oh!
There was an error while loading. Please reload this page.
Restore trait impl docs - #32935
Conversation
rust-highfive
commented
Apr 13, 2016
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @steveklabnik (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
steveklabnik
commented
Apr 13, 2016
Love this change conceptually, not great with rustdoc's codebase yet. r? @alexcrichton |
mitaa
commented
Apr 13, 2016
I think it would make sense to instead only Then you could remove the |
mitaa
commented
Apr 13, 2016
Could you also add some tests in |
GuillaumeGomez
commented
Apr 13, 2016
What the hell is happening in commits messages in here?! XD |
mitaa
commented
Apr 13, 2016
Actually, I think the current match on So the only necessary change would be to make here. |
alexcrichton
commented
Apr 13, 2016
I'm on board with everything @mitaa has mentioned :) |
Add test to check this resolvesrust-lang#24838 and rust-lang#26871.
da0ef9d to
d8d8669Comparepierzchalski
commented
Apr 14, 2016
Applied both of @mitaa's suggestions. Currently this means derived implementations also print any associated docs. Is that an issue? @GuillaumeGomez I don't know what you're talking about :D |
mitaa
commented
Apr 14, 2016
I would assume that they don't have any 😄
Yes, that's completely fine. |
In `test/rustdoc/manual_impl.rs` there are now three structs: * S1 implements and documents required method `a_method`. * S2 implements and documents `a_method` as well as provided method `b_method`. * S3 implements `a_method` and `b_method`, but only documents `b_method`. For a struct, we want the rendered trait impls to include documentation if and only if it appears on the trait implementation itself (since users can just go to the trait definition for anything not covered in the impl docs). This means we expect: * S1, S2, and S3 to all include top-level trait impl docs. * S1, S2, and S3 to exclude all trait definition docs. * S1 to show impl docs for `a_method`. * S2 to show impl docs for `a_method` and `b_method`. * S3 to show impl docs for `b_method`. These tests cover those cases.
pierzchalski
commented
Apr 15, 2016
@mitaa I'm looking at the docs (well, what I've updated the test to demonstrate the intended vs. actual behaviour, and now I'm hunting through |
mitaa
commented
Apr 15, 2016
Nice catch! For non-overridden default methods we actually render the method of the trait itself (which obviously has the doc attribute).
|
mitaa
commented
Apr 15, 2016
Well, that coupled with checking that |
We don't want to render default item docs but previously `doctraititem` naively delegated to the trait definition in those cases. Updated tests to also check that this doesn't strip default item docs from the trait definition.
pierzchalski
commented
Apr 15, 2016
Done. Also, it looks like the |
alexcrichton
commented
Apr 15, 2016
Thanks @pierzchalski! |
…s, r=alexcrichton Restore trait impl docs Currently, documentation on methods in trait implementations doesn't get rendered. This changes that; trait implementations have all documentation associated with impl items displayed (documentation from the trait definition is ignored). Fixesrust-lang#24838Fixesrust-lang#26871
Currently, documentation on methods in trait implementations doesn't get rendered. This changes that; trait implementations have all documentation associated with impl items displayed (documentation from the trait definition is ignored).
Fixes#24838
Fixes#26871