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

Fix warnings when documenting with --document-private-items #9903

Merged
merged 1 commit into from
Sep 13, 2021

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Sep 11, 2021

  • Use hyperlinks for URLs
  • Fix broken intra-doc links

This doesn't fix the following warning, since I wasn't sure what change
was appropriate:

warning: public documentation for `rustc_process` links to private item `self::core::compiler::Context::primary_packages`
   --> src/cargo/core/compiler/compilation.rs:164:22
    |
164 |     /// flag), see [`crate::core::compiler::Context::primary_packages`].
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this item is private
    |
    = note: `#[warn(rustdoc::private_intra_doc_links)]` on by default
    = note: this link resolves only because you passed `--document-private-items`, but will break without

To avoid noise, this doesn't add an allow either.

- Use hyperlinks for URLs
- Fix broken intra-doc links

This doesn't fix the following warning, since I wasn't sure what change
was appropriate:
```
warning: public documentation for `rustc_process` links to private item `self::core::compiler::Context::primary_packages`
   --> src/cargo/core/compiler/compilation.rs:164:22
    |
164 |     /// flag), see [`crate::core::compiler::Context::primary_packages`].
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this item is private
    |
    = note: `#[warn(rustdoc::private_intra_doc_links)]` on by default
    = note: this link resolves only because you passed `--document-private-items`, but will break without
```

To avoid noise, this doesn't add an `allow` either.
@@ -259,15 +259,15 @@ struct SerializedTarget<'a> {
/// Serialized as a list of strings for historical reasons.
kind: &'a TargetKind,
/// Corresponds to `--crate-type` compiler attribute.
/// See https://doc.rust-lang.org/reference/linkage.html
/// See <https://doc.rust-lang.org/reference/linkage.html>
crate_types: Vec<CrateType>,
name: &'a str,
src_path: Option<&'a PathBuf>,
edition: &'a str,
#[serde(rename = "required-features", skip_serializing_if = "Option::is_none")]
required_features: Option<Vec<&'a str>>,
/// Whether docs should be built for the target via `cargo doc`
Copy link
Member

Choose a reason for hiding this comment

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

nit (unrelated to this change): Seems like a period is missing at the end of this line.

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Collaborator

bors commented Sep 13, 2021

📌 Commit bf62ae9 has been approved by alexcrichton

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Sep 13, 2021
@bors
Copy link
Collaborator

bors commented Sep 13, 2021

⌛ Testing commit bf62ae9 with merge 1cf8c9d102385f80835414a1407b2c3efb6d9e92...

@bors
Copy link
Collaborator

bors commented Sep 13, 2021

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 13, 2021
@jyn514
Copy link
Member Author

jyn514 commented Sep 13, 2021

I think the warnings are from a new version of Rust being released last week?

 error: field is never read: `f1`
   --> tests/testsuite/config.rs:660:9
    |
660 |         f1: i64,
    |         ^^^^^^^
    |
note: the lint level is defined here
   --> tests/testsuite/main.rs:6:45
    |
6   | #![cfg_attr(feature = "deny-warnings", deny(warnings))]
    |                                             ^^^^^^^^
    = note: `#[deny(dead_code)]` implied by `#[deny(warnings)]`

@camelid
Copy link
Member

camelid commented Sep 13, 2021

I think the warnings are from a new version of Rust being released last week?

 error: field is never read: `f1`
   --> tests/testsuite/config.rs:660:9
    |
660 |         f1: i64,
    |         ^^^^^^^
    |
note: the lint level is defined here
   --> tests/testsuite/main.rs:6:45
    |
6   | #![cfg_attr(feature = "deny-warnings", deny(warnings))]
    |                                             ^^^^^^^^
    = note: `#[deny(dead_code)]` implied by `#[deny(warnings)]`

That sounds right; I know Miri's tests had to be updated recently to account for the newly-increased precision of dead_code.

@camelid
Copy link
Member

camelid commented Sep 13, 2021

I'll see if I can fix the error :)

Opened #9906.

@camelid
Copy link
Member

camelid commented Sep 13, 2021

This can probably be retried now, since #9906 has been merged.

@alexcrichton
Copy link
Member

@bors: retry

@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 Sep 13, 2021
@bors
Copy link
Collaborator

bors commented Sep 13, 2021

⌛ Testing commit bf62ae9 with merge ed8590e...

@bors
Copy link
Collaborator

bors commented Sep 13, 2021

☀️ Test successful - checks-actions
Approved by: alexcrichton
Pushing ed8590e to master...

@bors bors merged commit ed8590e into rust-lang:master Sep 13, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 17, 2021
Update cargo

13 commits in e515c3277bf0681bfc79a9e763861bfe26bb05db..33ee5f82edb50af87b952c5b28de0f5fb41ebf18
2021-09-08 14:32:15 +0000 to 2021-09-17 13:51:54 +0000
- Update curl-sys (rust-lang/cargo#9917)
- Bump Cargo's curl requirement to 7.79.0 (rust-lang/cargo#9914)
- Revert "When a dependency does not have a version, git or path, fails directly" (rust-lang/cargo#9911)
- Add some contributor docs for debugging testsuite tests. (rust-lang/cargo#9904)
- Fix warnings when documenting with `--document-private-items` (rust-lang/cargo#9903)
- Improve "wrong output" error. (rust-lang/cargo#9905)
- Fix warnings from better precision of `dead_code` lint (rust-lang/cargo#9906)
- Bump to 0.58.0, update changelog (rust-lang/cargo#9900)
- Fix rustc --profile=dev unstable check. (rust-lang/cargo#9898)
- config.md: fix typo (rust-lang/cargo#9896)
- Enable some tests on windows. (rust-lang/cargo#9893)
- Enable strip test on macos. (rust-lang/cargo#9889)
- Fix `cargo fix --edition` on stable. (rust-lang/cargo#9890)
@ehuss ehuss added this to the 1.57.0 milestone Feb 6, 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.

5 participants