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

When documenting private items in a binary, ignore warnings about links to private items #10142

Merged
merged 1 commit into from
May 6, 2022

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Nov 30, 2021

Previously, rustdoc would warn about linking to private items in a binary, even
though cargo unconditionally documents private items in a binary.
This changes cargo to silence the warning, since it's only relevant in
cases where the private items might not be documented.

Fixes rust-lang/rust#89600.

@rust-highfive
Copy link

r? @ehuss

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 30, 2021
tests/testsuite/doc.rs Outdated Show resolved Hide resolved
src/cargo/ops/cargo_compile.rs Show resolved Hide resolved
@ehuss
Copy link
Contributor

ehuss commented Dec 7, 2021

BTW, is there a reason this can't be done in rustdoc itself?

@bors
Copy link
Contributor

bors commented Dec 13, 2021

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

@ehuss ehuss added S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 14, 2021
Copy link
Member Author

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, is there a reason this can't be done in rustdoc itself?

Rustdoc does not special-case binaries, it's cargo that does that. If rustdoc hard-coded this, you wouldn't get warnings whenever you documented private items in a binary, even if you weren't going through cargo.

I guess it's possible to move the hardcoded --document-private-items from cargo to rustdoc, but that makes it impossible to hide the private items, so I'm not sure it's the best approach.

@jyn514 jyn514 force-pushed the bin-private-link branch 2 times, most recently from 8e2d11e to f3cd9b8 Compare February 14, 2022 17:38
@jyn514
Copy link
Member Author

jyn514 commented Feb 14, 2022

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. labels Feb 14, 2022
@bors
Copy link
Contributor

bors commented Feb 27, 2022

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

tests/testsuite/doc.rs Outdated Show resolved Hide resolved
…ks to private items

Previously, rustdoc would warn about linking to items in a binary, even
though cargo unconditionally documents private items in a binary.
This changes cargo to silence the warning, since it's only relevant in
cases where the private items might not be documented.
@ehuss
Copy link
Contributor

ehuss commented May 6, 2022

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented May 6, 2022

📌 Commit 727baf0 has been approved by ehuss

@bors bors 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 May 6, 2022
@bors
Copy link
Contributor

bors commented May 6, 2022

⌛ Testing commit 727baf0 with merge 08b8fe5...

@bors
Copy link
Contributor

bors commented May 6, 2022

☀️ Test successful - checks-actions
Approved by: ehuss
Pushing 08b8fe5 to master...

@bors bors merged commit 08b8fe5 into rust-lang:master May 6, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request May 12, 2022
Update cargo

20 commits in a44758ac805600edbb6ba51e7e6fb81a6077c0cd..3f052d8eed98c6a24f8b332fb2e6e6249d12d8c1
2022-05-04 02:29:34 +0000 to 2022-05-12 15:19:04 +0000
- pre-stabilization documentation for workspace inheritance (rust-lang/cargo#10659)
- test: Make curr_dir work in/out of workspace (rust-lang/cargo#10658)
- Fix no_cross_doctests race condition. (rust-lang/cargo#10660)
- Fix typo (rust-lang/cargo#10657)
- feat(install): Support `foo@version` like cargo-add (rust-lang/cargo#10650)
- fix typos found by the `typos-cli` crate (rust-lang/cargo#10649)
- feat(yank): Support foo@version like cargo-add (rust-lang/cargo#10597)
- add `cargo-features` to unstable docs for workspace inheritance (rust-lang/cargo#10648)
- Use the traits added to the Rust 2021 Edition prelude (rust-lang/cargo#10646)
- Pass `--target` to `rustdoc` for `cargo test` if specified with host target. (rust-lang/cargo#10594)
- Fix use of .. in dep-info-basedir (rust-lang/cargo#10281)
- fix some typos (rust-lang/cargo#10639)
- Move snapshot tests into testsuite (rust-lang/cargo#10638)
- Improve support of condition compilation checking (rust-lang/cargo#10566)
- When documenting private items in a binary, ignore warnings about links to private items (rust-lang/cargo#10142)
- Extend pkgid syntax with ``@`` support (rust-lang/cargo#10582)
- move one `snapshot/add` test into `testsuite/cargo_add/` (rust-lang/cargo#10631)
- Add caveat for covering features (rust-lang/cargo#10605)
- Improve CARGO_ENCODED_RUSTFLAGS and CARGO_ENCODED_RUSTDOCFLAGS variables docs (rust-lang/cargo#10633)
- reorganize `snapshot` tests to better work in contexts that sort by extension (rust-lang/cargo#10629)
@ehuss ehuss added this to the 1.62.0 milestone May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Link to private item warning irrelevant in binary crates
5 participants