Skip to content
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

Rust book documentation does not mention "crate documentation" #34329

Closed
gnzlbg opened this issue Jun 17, 2016 · 7 comments
Closed

Rust book documentation does not mention "crate documentation" #34329

gnzlbg opened this issue Jun 17, 2016 · 7 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-help-wanted Call for participation: Help is requested to fix this issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

Comments

@gnzlbg
Copy link
Contributor

gnzlbg commented Jun 17, 2016

I just enabled #![deny(missing_docs)] and I get:

error: missing documentation for crate

The section of the book on documentation, however, does not mention anything about "crate documentation" or how to add it.

@steveklabnik
Copy link
Member

https://doc.rust-lang.org/book/documentation.html#documenting-modules does mention it, but does not say "crate". Crates have a root module, and that's what the error refers to.

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Jun 17, 2016

I saw that, guessed that, and it fixed it. It just confused me a bit that the error talks about crate documentation (instead of saying missing documentation for the root module of the crate ...) and In the snippet of code in the docs (the second one for the root module) it just shows the comment, so it wasn't 100% clear to me that the comment is just supposed to float somewhere on the top level of the file.

I think both things could be a bit more clear and a bit more in sync (so it might make sense to label for error messages as well).

@steveklabnik steveklabnik added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. E-help-wanted Call for participation: Help is requested to fix this issue. labels Jun 27, 2016
@steveklabnik
Copy link
Member

I would be happy to work with anyone who wants to tackle this issue.

@GuillaumeRochat
Copy link
Contributor

@steveklabnik I will try to work on this one.

From what I understand, the Documenting Modules part in the rust book should be more explicit about root module and that the module documentation is at the very beginning of the file.

Also, the error should mention root module documentation rather than crate documentation.

@steveklabnik
Copy link
Member

Well, the error is fine, as you are missing documentation for the crate.

I think, rather than extending "Documenting modules", a new small section for "Crate documentation" is the way to go, since that's the problem that's trying to be solved. In there, we could explicitly say "You document a crate by putting an inner doc comment (//!) in the crate root, aka lib.rs."

Sound good?

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Jul 5, 2016

Sounds good to me!

@GuillaumeRochat
Copy link
Contributor

@steveklabnik @gnzlbg Something like that #34667 ?

steveklabnik added a commit to steveklabnik/rust that referenced this issue Jul 5, 2016
…tion, r=Manishearth

Add a section about crate documentation.

Fixes rust-lang#34329
?r @steveklabnik
steveklabnik added a commit to steveklabnik/rust that referenced this issue Jul 5, 2016
…tion, r=Manishearth

Add a section about crate documentation.

Fixes rust-lang#34329
?r @steveklabnik
@bors bors closed this as completed in 8c3efd2 Jul 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-help-wanted Call for participation: Help is requested to fix this issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Projects
None yet
Development

No branches or pull requests

3 participants