Skip to content

Commit 070e459

Browse files
committed
Auto merge of #9468 - PaulDance:fix-rustdoc-warnings, r=ehuss
Fix rustdoc warnings Change some small parts of the unit documentation in order to resolve warnings emitted when running `cargo doc` from the root of this project. It should help reduce the noise when checking that new or updated documentation builds correctly. See the commit messages for details about the modifications themselves, although they should be rather simple. Cheers, Paul.
2 parents f99f965 + 9ea1cbd commit 070e459

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

crates/cargo-util/src/paths.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ pub fn write<P: AsRef<Path>, C: AsRef<[u8]>>(path: P, contents: C) -> Result<()>
161161
.with_context(|| format!("failed to write `{}`", path.display()))
162162
}
163163

164-
/// Equivalent to [`write`], but does not write anything if the file contents
164+
/// Equivalent to [`write()`], but does not write anything if the file contents
165165
/// are identical to the given contents.
166166
pub fn write_if_changed<P: AsRef<Path>, C: AsRef<[u8]>>(path: P, contents: C) -> Result<()> {
167167
(|| -> Result<()> {
@@ -184,7 +184,7 @@ pub fn write_if_changed<P: AsRef<Path>, C: AsRef<[u8]>>(path: P, contents: C) ->
184184
Ok(())
185185
}
186186

187-
/// Equivalent to [`write`], but appends to the end instead of replacing the
187+
/// Equivalent to [`write()`], but appends to the end instead of replacing the
188188
/// contents.
189189
pub fn append(path: &Path, contents: &[u8]) -> Result<()> {
190190
(|| -> Result<()> {

src/cargo/core/features.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
//!
6363
//! 1. Add the option to the [`CliUnstable`] struct below. Flags can take an
6464
//! optional value if you want.
65-
//! 2. Update the [`CliUnstable::add`] function to parse the flag.
65+
//! 2. Update the [`CliUnstable::add`][CliUnstable] function to parse the flag.
6666
//! 3. Wherever the new functionality is implemented, call
6767
//! [`Config::cli_unstable`][crate::util::config::Config::cli_unstable] to
6868
//! get an instance of `CliUnstable` and check if the option has been
@@ -81,8 +81,8 @@
8181
//! macro below.
8282
//! 2. `-Z unstable-options`: Find the call to `fail_if_stable_opt` and
8383
//! remove it. Be sure to update the man pages if necessary.
84-
//! 3. `-Z` flag: Change the parsing code in [`CliUnstable::add`] to call
85-
//! `stabilized_warn` or `stabilized_err` and remove the field from
84+
//! 3. `-Z` flag: Change the parsing code in [`CliUnstable::add`][CliUnstable]
85+
//! to call `stabilized_warn` or `stabilized_err` and remove the field from
8686
//! `CliUnstable. Remove the `(unstable)` note in the clap help text if
8787
//! necessary.
8888
//! 2. Remove `masquerade_as_nightly_cargo` from any tests, and remove

src/cargo/sources/registry/mod.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ const VERSION_TEMPLATE: &str = "{version}";
189189
const PREFIX_TEMPLATE: &str = "{prefix}";
190190
const LOWER_PREFIX_TEMPLATE: &str = "{lowerprefix}";
191191

192-
/// A "source" for a [local](local::LocalRegistry) or
193-
/// [remote](remote::RemoteRegistry) registry.
192+
/// A "source" for a local (see `local::LocalRegistry`) or remote (see
193+
/// `remote::RemoteRegistry`) registry.
194194
///
195195
/// This contains common functionality that is shared between the two registry
196196
/// kinds, with the registry-specific logic implemented as part of the
@@ -415,8 +415,8 @@ impl<'a> RegistryDependency<'a> {
415415
}
416416
}
417417

418-
/// An abstract interface to handle both a [local](local::LocalRegistry) and
419-
/// [remote](remote::RemoteRegistry) registry.
418+
/// An abstract interface to handle both a local (see `local::LocalRegistry`)
419+
/// and remote (see `remote::RemoteRegistry`) registry.
420420
///
421421
/// This allows [`RegistrySource`] to abstractly handle both registry kinds.
422422
pub trait RegistryData {
@@ -460,9 +460,9 @@ pub trait RegistryData {
460460
/// Despite the name, this doesn't actually download anything. If the
461461
/// `.crate` is already downloaded, then it returns [`MaybeLock::Ready`].
462462
/// If it hasn't been downloaded, then it returns [`MaybeLock::Download`]
463-
/// which contains the URL to download. The [`crate::core::package::Download`]
463+
/// which contains the URL to download. The [`crate::core::package::Downloads`]
464464
/// system handles the actual download process. After downloading, it
465-
/// calls [`finish_download`] to save the downloaded file.
465+
/// calls [`Self::finish_download`] to save the downloaded file.
466466
///
467467
/// `checksum` is currently only used by local registries to verify the
468468
/// file contents (because local registries never actually download
@@ -474,7 +474,7 @@ pub trait RegistryData {
474474

475475
/// Finish a download by saving a `.crate` file to disk.
476476
///
477-
/// After [`crate::core::package::Download`] has finished a download,
477+
/// After [`crate::core::package::Downloads`] has finished a download,
478478
/// it will call this to save the `.crate` file. This is only relevant
479479
/// for remote registries. This should validate the checksum and save
480480
/// the given data to the on-disk cache.

0 commit comments

Comments
 (0)