Skip to content

Commit

Permalink
Auto merge of #9903 - jyn514:rustdoc-warnings, r=alexcrichton
Browse files Browse the repository at this point in the history
Fix warnings when documenting with `--document-private-items`

- 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.
  • Loading branch information
bors committed Sep 13, 2021
2 parents f7ca659 + bf62ae9 commit ed8590e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/cargo/core/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`
/// See https://doc.rust-lang.org/cargo/commands/cargo-doc.html#target-selection
/// See <https://doc.rust-lang.org/cargo/commands/cargo-doc.html#target-selection>
doc: bool,
doctest: bool,
/// Whether tests should be run for the target (`test` field in `Cargo.toml`)
Expand Down
4 changes: 2 additions & 2 deletions src/cargo/core/resolver/version_prefs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use crate::util::interning::InternedString;

/// A collection of preferences for particular package versions.
///
/// This is built up with [`prefer_package_id`] and [`prefer_dep`], then used to sort the set of
/// summaries for a package during resolution via [`sort_summaries`].
/// This is built up with [`Self::prefer_package_id`] and [`Self::prefer_dependency`], then used to sort the set of
/// summaries for a package during resolution via [`Self::sort_summaries`].
///
/// As written, a version is either "preferred" or "not preferred". Later extensions may
/// introduce more granular preferences.
Expand Down
4 changes: 2 additions & 2 deletions src/cargo/util/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ impl Rustc {
/// for no-op builds, we cache it here, based on compiler's mtime and rustup's
/// current toolchain.
///
/// https://github.com/rust-lang/cargo/issues/5315
/// https://github.com/rust-lang/rust/issues/49761
/// <https://github.com/rust-lang/cargo/issues/5315>
/// <https://github.com/rust-lang/rust/issues/49761>
#[derive(Debug)]
struct Cache {
cache_location: Option<PathBuf>,
Expand Down

0 comments on commit ed8590e

Please sign in to comment.