Skip to content

Don't warn for missing_doc_examples when item is #[doc(hidden)] - #76716

Merged
bors merged 6 commits into
rust-lang:masterfrom
GuillaumeGomez:stop-complains-on-doc-hidden
Mar 5, 2021
Merged

Don't warn for missing_doc_examples when item is #[doc(hidden)]#76716
bors merged 6 commits into
rust-lang:masterfrom
GuillaumeGomez:stop-complains-on-doc-hidden

Conversation

@GuillaumeGomez

Copy link
Copy Markdown
Member

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 14, 2020
@GuillaumeGomezGuillaumeGomez changed the title Stop complains on doc hiddenStop complains when item is #[doc(hidden)]Sep 14, 2020
@jyn514jyn514 added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. labels Sep 14, 2020
Comment threadsrc/librustdoc/passes/doc_test_lints.rs Outdated
Comment threadsrc/librustdoc/visit_ast.rs Outdated
Comment threadsrc/librustdoc/passes/doc_test_lints.rs Outdated
@jyn514jyn514 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 14, 2020
@jyn514jyn514 changed the title Stop complains when item is #[doc(hidden)]Don't warn for missing_doc_examples when item is #[doc(hidden)]Sep 14, 2020
@jyn514

Copy link
Copy Markdown
Member

I have a secondary concern too: it seems like a lot of code between this and missing_docs is being duplicated. Is there anyway to make them more consistent with one another? It seems a shame to have to update the same logic in two places.

@bors

This comment has been minimized.

@crlf0710crlf0710 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 8, 2020
@camelidcamelid added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 30, 2020
@Dylan-DPC-zzDylan-DPC-zz added S-waiting-on-team and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 30, 2020
@jyn514

Copy link
Copy Markdown
Member

@Dylan-DPC why did you mark this as waiting-on-team?

@GuillaumeGomez

Copy link
Copy Markdown
MemberAuthor

I am the team maybe? XD

@Dylan-DPC-zz

Copy link
Copy Markdown

This is pending on discussion between both of you and anyone else from the team :P

@jyn514

Copy link
Copy Markdown
Member

This is pending on discussion between both of you and anyone else from the team :P

Not that I'm aware of.

@jyn514jyn514 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-team labels Nov 29, 2020
@crlf0710crlf0710 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 18, 2020
@crlf0710crlf0710 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 15, 2021
@camelidcamelid removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Feb 12, 2021
@GuillaumeGomezGuillaumeGomez added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 2, 2021
@bors

bors commented Mar 4, 2021

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #82756) made this pull request unmergeable. Please resolve the merge conflicts.

@jyn514

Copy link
Copy Markdown
Member

This makes missing_doc_examples inconsistent with missing_docs:

warning: missing documentation for the crate
--> hidden.rs:1:1
|
1 | / #![warn(missing_docs)]
2 | | #[doc(hidden)]
3 | | pub fn f() {}
| |_____________^
|
note: the lint level is defined here
--> hidden.rs:1:9
|
1 | #![warn(missing_docs)]
| ^^^^^^^^^^^^

I do think the new behavior is better, but it also seems strange to have the two behave differently ... maybe we should also update missing_docs to have this behavior? But that requires keeping track of doc(hidden) in rustc itself, which would be a pretty big change from how it works now.

@Manishearth@ollie27 what do you think?

@jyn514

Copy link
Copy Markdown
Member

Oh wait I'm just dumb, that was warning that the crate root is missing docs, not that the item is missing docs. Adding crate-level docs fixes the issue:

$ cat hidden.rs //! some docs
#![warn(missing_docs)]
#[doc(hidden)]
pub fn f() {}

@GuillaumeGomez r=me with the merge conflict fixed

@GuillaumeGomez
GuillaumeGomezforce-pushed the stop-complains-on-doc-hidden branch from 25ecc0a to 1683cb1CompareMarch 4, 2021 20:23
@GuillaumeGomez

Copy link
Copy Markdown
MemberAuthor

@bors: r=jyn514

@bors

bors commented Mar 4, 2021

Copy link
Copy Markdown
Collaborator

📌 Commit 1683cb1 has been approved by jyn514

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 4, 2021
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 5, 2021
…c-hidden, r=jyn514
Don't warn for `missing_doc_examples` when item is #[doc(hidden)]
r? ``@jyn514``
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Mar 5, 2021
…c-hidden, r=jyn514
Don't warn for `missing_doc_examples` when item is #[doc(hidden)]
r? ```@jyn514```
@JohnTitorJohnTitor mentioned this pull request Mar 5, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 5, 2021
…laumeGomez
Rollup of 5 pull requests
Successful merges:
- rust-lang#76716 (Don't warn for `missing_doc_examples` when item is #[doc(hidden)])
- rust-lang#82088 (Shorten html::render)
- rust-lang#82690 (Update rustdoc documentation)
- rust-lang#82752 (Add a regression test for issue-81712)
- rust-lang#82765 (Fix polymorphization ICE on associated types in trait decls using const generics in bounds)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
m-ou-se added a commit to m-ou-se/rust that referenced this pull request Mar 5, 2021
…c-hidden, r=jyn514
Don't warn for `missing_doc_examples` when item is #[doc(hidden)]
r? ````@jyn514````
@m-ou-sem-ou-se mentioned this pull request Mar 5, 2021
@bors
bors merged commit 95bbc7e into rust-lang:masterMar 5, 2021
@rustbotrustbot added this to the 1.52.0 milestone Mar 5, 2021
@GuillaumeGomez
GuillaumeGomez deleted the stop-complains-on-doc-hidden branch March 5, 2021 13:36
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@GuillaumeGomez@jyn514@bors@Dylan-DPC-zz@crlf0710@rust-highfive@camelid@rustbot