Skip to content

Commit 878caf7

Browse files
committed
docs: Surround identifiers in backticks
This was mostly done by clippy via `clippy::doc_markdown`. I then reviewed it to fix words that shouldn't have it or where `--fix` put the backtick in the wrong location.
1 parent 0b28167 commit 878caf7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+128
-128
lines changed

benches/benchsuite/src/bin/capture-last-use.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Utility for capturing a global cache last-use database based on the files
22
//! on a real-world system.
33
//!
4-
//! This will look in the CARGO_HOME of the current system and record last-use
4+
//! This will look in the `CARGO_HOME` of the current system and record last-use
55
//! data for all files in the cache. This is intended to provide a real-world
66
//! example for a benchmark that should be close to what a real set of data
77
//! should look like.

crates/cargo-test-support/src/compare.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ macro_rules! impl_from_tuple_for_inmemorydir {
621621
};
622622
}
623623

624-
/// Extend `impl_from_tuple_for_inmemorydir`` to generate for the specified tuple and all smaller
624+
/// Extend `impl_from_tuple_for_inmemorydir` to generate for the specified tuple and all smaller
625625
/// tuples
626626
macro_rules! impl_from_tuples_for_inmemorydir {
627627
($var1:ident $path1:ident $data1:ident, $($var:ident $path:ident $data:ident),+) => {

crates/cargo-test-support/src/containers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//! with the running container.
66
//!
77
//! Tests using containers must use `#[cargo_test(container_test)]` to disable
8-
//! them unless the CARGO_CONTAINER_TESTS environment variable is set.
8+
//! them unless the `CARGO_CONTAINER_TESTS` environment variable is set.
99
1010
use cargo_util::ProcessBuilder;
1111
use std::collections::HashMap;
@@ -36,7 +36,7 @@ pub struct ContainerHandle {
3636
/// This can only be used on Linux. macOS and Windows docker doesn't allow
3737
/// direct connection to the container.
3838
pub ip_address: String,
39-
/// Port mappings of container_port to host_port for ports exposed via EXPOSE.
39+
/// Port mappings of `container_port` to `host_port` for ports exposed via EXPOSE.
4040
pub port_mappings: HashMap<u16, u16>,
4141
}
4242

crates/cargo-test-support/src/cross_compile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! Note that cross-testing is very limited. You need to install the
44
//! "alternate" target to the host (32-bit for 64-bit hosts or vice-versa).
55
//!
6-
//! Set CFG_DISABLE_CROSS_TESTS=1 environment variable to disable these tests
6+
//! Set `CFG_DISABLE_CROSS_TESTS=1` environment variable to disable these tests
77
//! if you are unable to use the alternate target. Unfortunately 32-bit
88
//! support on macOS is going away, so macOS users are out of luck.
99
//!

crates/cargo-test-support/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ impl Execs {
890890
///
891891
/// Prefer [`Execs::with_stdout_data`] where possible.
892892
/// - `with` cannot be snapshotted
893-
/// - The absence of `without`` can either mean success or that the string being looked for
893+
/// - The absence of `without` can either mean success or that the string being looked for
894894
/// changed.
895895
///
896896
/// </div>

crates/cargo-test-support/src/paths.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ static CARGO_INTEGRATION_TEST_DIR: &str = "cit";
1717
static GLOBAL_ROOT: OnceLock<Mutex<Option<PathBuf>>> = OnceLock::new();
1818

1919
/// This is used when running cargo is pre-CARGO_TARGET_TMPDIR
20-
/// TODO: Remove when CARGO_TARGET_TMPDIR grows old enough.
20+
/// TODO: Remove when `CARGO_TARGET_TMPDIR` grows old enough.
2121
fn global_root_legacy() -> PathBuf {
2222
let mut path = t!(env::current_exe());
2323
path.pop(); // chop off exe name

crates/cargo-test-support/src/publish.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ fn read_new_post(new_path: &Path) -> (Vec<u8>, Vec<u8>) {
166166
///
167167
/// - `expected_crate_name` should be something like `foo-0.0.1.crate`.
168168
/// - `expected_files` should be a complete list of files in the crate
169-
/// (relative to expected_crate_name).
169+
/// (relative to `expected_crate_name`).
170170
/// - `expected_contents` should be a list of `(file_name, contents)` tuples
171171
/// to validate the contents of the given file. Only the listed files will
172172
/// be checked (others will be ignored).

crates/cargo-util-schemas/src/manifest/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1680,7 +1680,7 @@ impl<'de> de::Deserialize<'de> for InvalidCargoFeatures {
16801680
}
16811681
}
16821682

1683-
/// A StringOrVec can be parsed from either a TOML string or array,
1683+
/// This can be parsed from either a TOML string or array,
16841684
/// but is always stored as a vector.
16851685
#[derive(Clone, Debug, Serialize, Eq, PartialEq, PartialOrd, Ord)]
16861686
#[cfg_attr(feature = "unstable-schema", derive(schemars::JsonSchema))]

crates/cargo-util/src/paths.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ pub fn write<P: AsRef<Path>, C: AsRef<[u8]>>(path: P, contents: C) -> Result<()>
189189

190190
/// Writes a file to disk atomically.
191191
///
192-
/// write_atomic uses tempfile::persist to accomplish atomic writes.
192+
/// This uses `tempfile::persist` to accomplish atomic writes.
193193
pub fn write_atomic<P: AsRef<Path>, C: AsRef<[u8]>>(path: P, contents: C) -> Result<()> {
194194
let path = path.as_ref();
195195

crates/home/src/env.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ use std::{
1010
/// in-process unit testing by rustup.
1111
pub trait Env {
1212
/// Return the path to the users home dir, or None if any error occurs:
13-
/// see home_inner.
13+
/// see `home_inner`.
1414
fn home_dir(&self) -> Option<PathBuf>;
1515
/// Return the current working directory.
1616
fn current_dir(&self) -> io::Result<PathBuf>;
17-
/// Get an environment variable, as per std::env::var_os.
17+
/// Get an environment variable, as per `std::env::var_os`.
1818
fn var_os(&self, key: &str) -> Option<OsString>;
1919
}
2020

@@ -47,7 +47,7 @@ pub fn home_dir_with_env(env: &dyn Env) -> Option<PathBuf> {
4747
env.home_dir()
4848
}
4949

50-
/// Variant of cargo_home where the environment source is parameterized. This is
50+
/// Variant of `cargo_home` where the environment source is parameterized. This is
5151
/// specifically to support in-process testing scenarios as environment
5252
/// variables and user home metadata are normally process global state. See the
5353
/// [`Env`] trait.
@@ -56,10 +56,10 @@ pub fn cargo_home_with_env(env: &dyn Env) -> io::Result<PathBuf> {
5656
cargo_home_with_cwd_env(env, &cwd)
5757
}
5858

59-
/// Variant of cargo_home_with_cwd where the environment source is
59+
/// Variant of `cargo_home_with_cwd` where the environment source is
6060
/// parameterized. This is specifically to support in-process testing scenarios
6161
/// as environment variables and user home metadata are normally process global
62-
/// state. See the OsEnv trait.
62+
/// state. See the `OsEnv` trait.
6363
pub fn cargo_home_with_cwd_env(env: &dyn Env, cwd: &Path) -> io::Result<PathBuf> {
6464
match env.var_os("CARGO_HOME").filter(|h| !h.is_empty()) {
6565
Some(home) => {
@@ -76,19 +76,19 @@ pub fn cargo_home_with_cwd_env(env: &dyn Env, cwd: &Path) -> io::Result<PathBuf>
7676
}
7777
}
7878

79-
/// Variant of cargo_home_with_cwd where the environment source is
79+
/// Variant of `cargo_home_with_cwd` where the environment source is
8080
/// parameterized. This is specifically to support in-process testing scenarios
8181
/// as environment variables and user home metadata are normally process global
82-
/// state. See the OsEnv trait.
82+
/// state. See the `OsEnv` trait.
8383
pub fn rustup_home_with_env(env: &dyn Env) -> io::Result<PathBuf> {
8484
let cwd = env.current_dir()?;
8585
rustup_home_with_cwd_env(env, &cwd)
8686
}
8787

88-
/// Variant of cargo_home_with_cwd where the environment source is
88+
/// Variant of `cargo_home_with_cwd` where the environment source is
8989
/// parameterized. This is specifically to support in-process testing scenarios
9090
/// as environment variables and user home metadata are normally process global
91-
/// state. See the OsEnv trait.
91+
/// state. See the `OsEnv` trait.
9292
pub fn rustup_home_with_cwd_env(env: &dyn Env, cwd: &Path) -> io::Result<PathBuf> {
9393
match env.var_os("RUSTUP_HOME").filter(|h| !h.is_empty()) {
9494
Some(home) => {

crates/mdman/src/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub fn parse_name_and_section(text: &str) -> Result<(&str, u8), Error> {
2424
Ok((name, section))
2525
}
2626

27-
/// Extracts the text from a header after Tag::Heading has been received.
27+
/// Extracts the text from a header after `Tag::Heading` has been received.
2828
pub fn header_text<'e>(parser: &mut EventIter<'e>) -> Result<CowStr<'e>, Error> {
2929
let text = match parser.next() {
3030
Some((Event::Text(t), _range)) => t,

crates/rustfix/src/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub struct DiagnosticSpan {
3636
/// Is this a "primary" span -- meaning the point, or one of the points,
3737
/// where the error occurred?
3838
pub is_primary: bool,
39-
/// Source text from the start of line_start to the end of line_end.
39+
/// Source text from the start of `line_start` to the end of `line_end`.
4040
pub text: Vec<DiagnosticSpanLine>,
4141
/// Label that should be placed at this location (if any)
4242
label: Option<String>,

src/cargo/core/compiler/build_context/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ impl<'a, 'gctx> BuildContext<'a, 'gctx> {
121121

122122
/// Gets the host architecture triple.
123123
///
124-
/// For example, x86_64-unknown-linux-gnu, would be
125-
/// - machine: x86_64,
126-
/// - hardware-platform: unknown,
127-
/// - operating system: linux-gnu.
124+
/// For example, `x86_64-unknown-linux-gnu`, would be
125+
/// - machine: `x86_64`,
126+
/// - hardware-platform: `unknown`,
127+
/// - operating system: `linux-gnu`.
128128
pub fn host_triple(&self) -> InternedString {
129129
self.target_data.rustc.host
130130
}

src/cargo/core/compiler/build_context/target_info.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ pub struct FileType {
9393
}
9494

9595
impl FileType {
96-
/// The filename for this FileType crated by rustc.
96+
/// The filename for this `FileType` crated by rustc.
9797
pub fn output_filename(&self, target: &Target, metadata: Option<&str>) -> String {
9898
match metadata {
9999
Some(metadata) => format!(
@@ -107,7 +107,7 @@ impl FileType {
107107
}
108108
}
109109

110-
/// The filename for this FileType that Cargo should use when "uplifting"
110+
/// The filename for this `FileType` that Cargo should use when "uplifting"
111111
/// it to the destination directory.
112112
pub fn uplift_filename(&self, target: &Target) -> String {
113113
let name = match target.binary_filename() {
@@ -513,10 +513,10 @@ impl TargetInfo {
513513
parse_crate_type(crate_type, &process, output, error, &mut output.lines())
514514
}
515515

516-
/// Returns all the file types generated by rustc for the given mode/target_kind.
516+
/// Returns all the file types generated by rustc for the given `mode`/`target_kind`.
517517
///
518518
/// The first value is a Vec of file types generated, the second value is
519-
/// a list of CrateTypes that are not supported by the given target.
519+
/// a list of `CrateTypes` that are not supported by the given target.
520520
pub fn rustc_outputs(
521521
&self,
522522
mode: CompileMode,

src/cargo/core/compiler/build_plan.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//! A graph-like structure used to represent the rustc commands to build the package and the
22
//! interdependencies between them.
33
//!
4-
//! The BuildPlan structure is used to store the dependency graph of a dry run so that it can be
5-
//! shared with an external build system. Each Invocation in the BuildPlan comprises a single
4+
//! The `BuildPlan` structure is used to store the dependency graph of a dry run so that it can be
5+
//! shared with an external build system. Each Invocation in the `BuildPlan` comprises a single
66
//! subprocess and defines the build environment, the outputs produced by the subprocess, and the
77
//! dependencies on other Invocations.
88

src/cargo/core/compiler/build_runner/compilation_files.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ impl<'a, 'gctx: 'a> CompilationFiles<'a, 'gctx> {
328328
self.layout(unit.kind).build().join(dir)
329329
}
330330

331-
/// Returns the "OUT_DIR" directory for running a build script.
331+
/// Returns the "`OUT_DIR`" directory for running a build script.
332332
/// `/path/to/target/{debug,release}/build/PKG-HASH/out`
333333
pub fn build_script_out_dir(&self, unit: &Unit) -> PathBuf {
334334
self.build_script_run_dir(unit).join("out")
@@ -375,7 +375,7 @@ impl<'a, 'gctx: 'a> CompilationFiles<'a, 'gctx> {
375375
.map(Arc::clone)
376376
}
377377

378-
/// Returns the path where the output for the given unit and FileType
378+
/// Returns the path where the output for the given unit and `FileType`
379379
/// should be uplifted to.
380380
///
381381
/// Returns `None` if the unit shouldn't be uplifted (for example, a

src/cargo/core/compiler/build_runner/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ pub struct BuildRunner<'a, 'gctx> {
8080
pub lto: HashMap<Unit, Lto>,
8181

8282
/// Map of Doc/Docscrape units to metadata for their -Cmetadata flag.
83-
/// See Context::find_metadata_units for more details.
83+
/// See `Context::find_metadata_units` for more details.
8484
pub metadata_for_doc_units: HashMap<Unit, Metadata>,
8585

8686
/// Set of metadata of Docscrape units that fail before completion, e.g.
@@ -415,7 +415,7 @@ impl<'a, 'gctx> BuildRunner<'a, 'gctx> {
415415
&self.bcx.unit_graph[unit]
416416
}
417417

418-
/// Returns the RunCustomBuild Unit associated with the given Unit.
418+
/// Returns the `RunCustomBuild` Unit associated with the given Unit.
419419
///
420420
/// If the package does not have a build script, this returns None.
421421
pub fn find_build_script_unit(&self, unit: &Unit) -> Option<Unit> {
@@ -431,7 +431,7 @@ impl<'a, 'gctx> BuildRunner<'a, 'gctx> {
431431
.map(|unit_dep| unit_dep.unit.clone())
432432
}
433433

434-
/// Returns the metadata hash for the RunCustomBuild Unit associated with
434+
/// Returns the metadata hash for the `RunCustomBuild` Unit associated with
435435
/// the given unit.
436436
///
437437
/// If the package does not have a build script, this returns None.
@@ -440,7 +440,7 @@ impl<'a, 'gctx> BuildRunner<'a, 'gctx> {
440440
Some(self.get_run_build_script_metadata(&script_unit))
441441
}
442442

443-
/// Returns the metadata hash for a RunCustomBuild unit.
443+
/// Returns the metadata hash for a `RunCustomBuild` unit.
444444
pub fn get_run_build_script_metadata(&self, unit: &Unit) -> Metadata {
445445
assert!(unit.mode.is_run_custom_build());
446446
self.files().metadata(unit)

src/cargo/core/compiler/compilation.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub struct Compilation<'gctx> {
8181
/// All directories for the output of native build commands.
8282
///
8383
/// This is currently used to drive some entries which are added to the
84-
/// LD_LIBRARY_PATH as appropriate.
84+
/// `LD_LIBRARY_PATH` as appropriate.
8585
///
8686
/// The order should be deterministic.
8787
pub native_dirs: BTreeSet<PathBuf>,
@@ -113,10 +113,10 @@ pub struct Compilation<'gctx> {
113113

114114
/// Rustc process to be used by default
115115
rustc_process: ProcessBuilder,
116-
/// Rustc process to be used for workspace crates instead of rustc_process
116+
/// Rustc process to be used for workspace crates instead of `rustc_process`
117117
rustc_workspace_wrapper_process: ProcessBuilder,
118-
/// Optional rustc process to be used for primary crates instead of either rustc_process or
119-
/// rustc_workspace_wrapper_process
118+
/// Optional rustc process to be used for primary crates instead of either `rustc_process` or
119+
/// `rustc_workspace_wrapper_process`
120120
primary_rustc_process: Option<ProcessBuilder>,
121121

122122
target_runners: HashMap<CompileKind, Option<(PathBuf, Vec<String>)>>,
@@ -403,7 +403,7 @@ impl<'gctx> Compilation<'gctx> {
403403
}
404404
}
405405

406-
/// Prepares a rustc_tool process with additional environment variables
406+
/// Prepares a `rustc_tool` process with additional environment variables
407407
/// that are only relevant in a context that has a unit
408408
fn fill_rustc_tool_env(mut cmd: ProcessBuilder, unit: &Unit) -> ProcessBuilder {
409409
if unit.target.is_executable() {

src/cargo/core/compiler/custom_build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ pub struct BuildOutput {
111111
/// inserted during `build_map`. The rest of the entries are added
112112
/// immediately after each build script runs.
113113
///
114-
/// The `Metadata` is the unique metadata hash for the RunCustomBuild Unit of
114+
/// The `Metadata` is the unique metadata hash for the `RunCustomBuild` Unit of
115115
/// the package. It needs a unique key, since the build script can be run
116116
/// multiple times with different profiles or features. We can't embed a
117117
/// `Unit` because this structure needs to be shareable between threads.
@@ -150,7 +150,7 @@ pub struct BuildScripts {
150150
/// This is the set of transitive dependencies that are host-only
151151
/// (proc-macro, plugin, build-dependency) that contain a build script.
152152
/// Any `BuildOutput::library_paths` path relative to `target` will be
153-
/// added to LD_LIBRARY_PATH so that the compiler can find any dynamic
153+
/// added to `LD_LIBRARY_PATH` so that the compiler can find any dynamic
154154
/// libraries a build script may have generated.
155155
pub plugins: BTreeSet<(PackageId, Metadata)>,
156156
}

src/cargo/core/compiler/fingerprint/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@
6969
//! `cargo rustc` extra args | ✓ | ✓
7070
//! [`CompileMode`] | ✓ | ✓
7171
//! Target Name | ✓ | ✓
72-
//! TargetKind (bin/lib/etc.) | ✓ | ✓
72+
//! `TargetKind` (bin/lib/etc.) | ✓ | ✓
7373
//! Enabled Features | ✓ | ✓
7474
//! Declared Features | ✓ |
7575
//! Immediate dependency’s hashes | ✓[^1] | ✓
7676
//! [`CompileKind`] (host/target) | ✓ | ✓
77-
//! __CARGO_DEFAULT_LIB_METADATA[^4] | | ✓
78-
//! package_id | | ✓
77+
//! `__CARGO_DEFAULT_LIB_METADATA`[^4] | | ✓
78+
//! `package_id` | | ✓
7979
//! authors, description, homepage, repo | ✓ |
8080
//! Target src path relative to ws | ✓ |
8181
//! Target flags (test/bench/for_host/edition) | ✓ |
@@ -84,7 +84,7 @@
8484
//! RUSTFLAGS/RUSTDOCFLAGS | ✓ |
8585
//! [`Lto`] flags | ✓ | ✓
8686
//! config settings[^5] | ✓ |
87-
//! is_std | | ✓
87+
//! `is_std` | | ✓
8888
//! `[lints]` table[^6] | ✓ |
8989
//! `[lints.rust.unexpected_cfgs.check-cfg]` | ✓ |
9090
//!
@@ -738,7 +738,7 @@ enum LocalFingerprint {
738738
/// for us to look at. If any of those files are newer than this file then
739739
/// we need to recompile.
740740
///
741-
/// If the `checksum` bool is true then the dep_info file is expected to
741+
/// If the `checksum` bool is true then the `dep_info` file is expected to
742742
/// contain file checksums instead of file mtimes.
743743
CheckDepInfo { dep_info: PathBuf, checksum: bool },
744744

src/cargo/core/compiler/job_queue/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ use crate::util::{DependencyQueue, GlobalContext, Progress, ProgressStyle, Queue
151151

152152
/// This structure is backed by the `DependencyQueue` type and manages the
153153
/// queueing of compilation steps for each package. Packages enqueue units of
154-
/// work and then later on the entire graph is converted to DrainState and
154+
/// work and then later on the entire graph is converted to `DrainState` and
155155
/// executed.
156156
pub struct JobQueue<'gctx> {
157157
queue: DependencyQueue<Unit, Artifact, Job>,
@@ -163,7 +163,7 @@ pub struct JobQueue<'gctx> {
163163
/// actual compilation step of each package. Packages enqueue units of work and
164164
/// then later on the entire graph is processed and compiled.
165165
///
166-
/// It is created from JobQueue when we have fully assembled the crate graph
166+
/// It is created from `JobQueue` when we have fully assembled the crate graph
167167
/// (i.e., all package dependencies are known).
168168
struct DrainState<'gctx> {
169169
// This is the length of the DependencyQueue when starting out
@@ -265,9 +265,9 @@ struct ErrorToHandle {
265265
/// care about individually reporting every thread that it broke; just the
266266
/// first is enough.
267267
///
268-
/// The exception where print_always is true is that we do report every
268+
/// The exception where `print_always` is true is that we do report every
269269
/// instance of a rustc invocation that failed with diagnostics. This
270-
/// corresponds to errors from Message::Finish.
270+
/// corresponds to errors from `Message::Finish`.
271271
print_always: bool,
272272
}
273273

0 commit comments

Comments
 (0)