diff --git a/crates/mdman/doc/out/mdman.md b/crates/mdman/doc/out/mdman.md index 8f6f1018c72..aefafa48bbd 100644 --- a/crates/mdman/doc/out/mdman.md +++ b/crates/mdman/doc/out/mdman.md @@ -54,7 +54,7 @@ man page:
-t type
-
Specifies the output type. The following output types are supported:

+

Specifies the output type. The following output types are supported:

+ +
-o outdir
-
Specifies the directory where to save the output.
+

Specifies the directory where to save the output.

+
--url base_url
-
Specifies a base URL to use for relative URLs within the document. Any -relative URL will be joined with this URL.
+

Specifies a base URL to use for relative URLs within the document. Any +relative URL will be joined with this URL.

+
--man name:section=url
-
Specifies a URL to use for the given man page. When the {{man name section}} expression is used, the given URL will be inserted as a link. This +

Specifies a URL to use for the given man page. When the {{man name section}} expression is used, the given URL will be inserted as a link. This may be specified multiple times. If a man page reference does not have a matching --man entry, then a relative link to a file named name.md will -be used.

+be used.

+
sources…
-
The source input filename, may be specified multiple times.
+

The source input filename, may be specified multiple times.

+
diff --git a/crates/mdman/src/format/md.rs b/crates/mdman/src/format/md.rs index 091e006f89d..c10628c29c9 100644 --- a/crates/mdman/src/format/md.rs +++ b/crates/mdman/src/format/md.rs @@ -67,8 +67,7 @@ impl super::Formatter for MdFormatter { let rendered_block = self.render_html(block)?; write!( result, - "
{}
\n\n", - unwrap_p(&rendered_block) + "
{rendered_block}
\n\n", )?; Ok(result) } diff --git a/crates/mdman/tests/compare/expected/links.md b/crates/mdman/tests/compare/expected/links.md index 11afcf3bd24..526f01040d4 100644 --- a/crates/mdman/tests/compare/expected/links.md +++ b/crates/mdman/tests/compare/expected/links.md @@ -34,7 +34,8 @@ Shortcut unknown: [shortcut unknown]
-
Testing an included link.
+

Testing an included link.

+
@@ -44,8 +45,9 @@ Shortcut unknown: [shortcut unknown]
-
Example link. -See other-cmd(1), local-cmd(1)
+

Example link. +See other-cmd(1), local-cmd(1)

+
diff --git a/crates/mdman/tests/compare/expected/options.1 b/crates/mdman/tests/compare/expected/options.1 index a28db820d28..984129822b1 100644 --- a/crates/mdman/tests/compare/expected/options.1 +++ b/crates/mdman/tests/compare/expected/options.1 @@ -53,6 +53,25 @@ This has multiple flags. .RS 4 A named argument. .RE +.sp +\fB\-\-complex\fR +.RS 4 +This option has a list. +.sp +.RS 4 +\h'-04'\(bu\h'+03'alpha +.RE +.sp +.RS 4 +\h'-04'\(bu\h'+03'beta +.RE +.sp +.RS 4 +\h'-04'\(bu\h'+03'gamma +.RE +.sp +Then text continues here. +.RE .SS "Common Options" .sp \fB@\fR\fIfilename\fR diff --git a/crates/mdman/tests/compare/expected/options.md b/crates/mdman/tests/compare/expected/options.md index 0178cac2d7c..5a8b7af13ca 100644 --- a/crates/mdman/tests/compare/expected/options.md +++ b/crates/mdman/tests/compare/expected/options.md @@ -29,16 +29,30 @@ A description of the command.
--foo-bar
-
Demo emphasis, strong, strike
+

Demo emphasis, strong, strike

+
-p spec
--package spec
-
This has multiple flags.
+

This has multiple flags.

+
named-arg…
-
A named argument.
+

A named argument.

+
+ + +
--complex
+

This option has a list.

+ +

Then text continues here.

+
@@ -47,19 +61,23 @@ A description of the command.
@filename
-
Load from filename.
+

Load from filename.

+
--foo [bar]
-
Flag with optional value.
+

Flag with optional value.

+
--foo[=bar]
-
Alternate syntax for optional value (with required = for disambiguation).
+

Alternate syntax for optional value (with required = for disambiguation).

+
--split-block
-
An option where the description has a block statement that is split across multiple lines
+

An option where the description has a block statement that is split across multiple lines

+
diff --git a/crates/mdman/tests/compare/expected/options.txt b/crates/mdman/tests/compare/expected/options.txt index f585cba466a..7cf9b7aa086 100644 --- a/crates/mdman/tests/compare/expected/options.txt +++ b/crates/mdman/tests/compare/expected/options.txt @@ -32,6 +32,17 @@ OPTIONS named-arg… A named argument. + --complex + This option has a list. + + o alpha + + o beta + + o gamma + + Then text continues here. + Common Options @filename Load from filename. diff --git a/crates/mdman/tests/compare/options.md b/crates/mdman/tests/compare/options.md index b6a4f44053c..bce90980f10 100644 --- a/crates/mdman/tests/compare/options.md +++ b/crates/mdman/tests/compare/options.md @@ -40,6 +40,16 @@ This has multiple flags. A named argument. {{/option}} +{{#option "`--complex`"}} +This option has a list. + +- alpha +- beta +- gamma + +Then text continues here. +{{/option}} + {{/options}} ### Common Options diff --git a/src/doc/book.toml b/src/doc/book.toml index d748e6ee6d6..cfb61464ad3 100644 --- a/src/doc/book.toml +++ b/src/doc/book.toml @@ -3,6 +3,7 @@ title = "The Cargo Book" authors = ["Alex Crichton", "Steve Klabnik", "Carol Nichols", "with contributions from the Rust community"] [output.html] +additional-css = ["theme/cargo.css"] smart-punctuation = true # Enable smart-punctuation feature for more than quotes. git-repository-url = "https://github.com/rust-lang/cargo/tree/master/src/doc/src" edit-url-template = "https://github.com/rust-lang/cargo/edit/master/src/doc/{path}" diff --git a/src/doc/src/commands/cargo-add.md b/src/doc/src/commands/cargo-add.md index e61f8408eb8..4f1ab7fca18 100644 --- a/src/doc/src/commands/cargo-add.md +++ b/src/doc/src/commands/cargo-add.md @@ -40,35 +40,42 @@ dependency will be listed in the command's output.
--git url
-
Git URL to add the specified crate from.
+

Git URL to add the specified crate from.

+
--branch branch
-
Branch to use when adding from git.
+

Branch to use when adding from git.

+
--tag tag
-
Tag to use when adding from git.
+

Tag to use when adding from git.

+
--rev sha
-
Specific commit to use when adding from git.
+

Specific commit to use when adding from git.

+
--path path
-
Filesystem path to local crate to add.
+

Filesystem path to local crate to add.

+
--base base
-
The path base to use when adding a local crate.

-

Unstable (nightly-only)

+

The path base to use when adding a local crate.

+

Unstable (nightly-only)

+
--registry registry
-
Name of the registry to use. Registry names are defined in Cargo config +

Name of the registry to use. Registry names are defined in Cargo config files. If not specified, the default registry is used, which is defined by the registry.default config key which defaults to -crates-io.

+crates-io.

+
@@ -78,16 +85,19 @@ which is defined by the registry.default config key which defaults
--dev
-
Add as a development dependency.
+

Add as a development dependency.

+
--build
-
Add as a build dependency.
+

Add as a build dependency.

+
--target target
-
Add as a dependency to the given target platform.

-

To avoid unexpected shell expansions, you may use quotes around each target, e.g., --target 'cfg(unix)'.

+

Add as a dependency to the given target platform.

+

To avoid unexpected shell expansions, you may use quotes around each target, e.g., --target 'cfg(unix)'.

+
@@ -97,48 +107,57 @@ which is defined by the registry.default config key which defaults
--dry-run
-
Don’t actually write the manifest
+

Don’t actually write the manifest

+
--rename name
-
Rename the dependency.
+

Rename the dependency.

+
--optional
-
Mark the dependency as optional.
+

Mark the dependency as optional.

+
--no-optional
-
Mark the dependency as required.
+

Mark the dependency as required.

+
--public
-
Mark the dependency as public.

+

Mark the dependency as public.

The dependency can be referenced in your library’s public API.

-

Unstable (nightly-only)

+

Unstable (nightly-only)

+
--no-public
-
Mark the dependency as private.

+

Mark the dependency as private.

While you can use the crate in your implementation, it cannot be referenced in your public API.

-

Unstable (nightly-only)

+

Unstable (nightly-only)

+
--no-default-features
-
Disable the default features.
+

Disable the default features.

+
--default-features
-
Re-enable the default features.
+

Re-enable the default features.

+
-F features
--features features
-
Space or comma separated list of features to +

Space or comma separated list of features to activate. When adding multiple crates, the features for a specific crate may be enabled with package-name/feature-name syntax. This flag may be specified multiple times, -which enables all specified features.

+which enables all specified features.

+
@@ -149,21 +168,23 @@ which enables all specified features.
-v
--verbose
-
Use verbose output. May be specified twice for “very verbose” output which +

Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

+config value.

+
-q
--quiet
-
Do not print cargo log messages. +

Do not print cargo log messages. May also be specified with the term.quiet -config value.

+config value.

+
--color when
-
Control when colored output is used. Valid values:

+

Control when colored output is used. Valid values:

May also be specified with the term.color -config value.

+config value.

+
@@ -179,21 +201,24 @@ terminal.
--manifest-path path
-
Path to the Cargo.toml file. By default, Cargo searches for the -Cargo.toml file in the current directory or any parent directory.
+

Path to the Cargo.toml file. By default, Cargo searches for the +Cargo.toml file in the current directory or any parent directory.

+
-p spec
--package spec
-
Add dependencies to only the specified package.
+

Add dependencies to only the specified package.

+
--ignore-rust-version
-
Ignore rust-version specification in packages.
+

Ignore rust-version specification in packages.

+
--locked
-
Asserts that the exact same dependencies and versions are used as when the +

Asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of the following scenarios arises:

It may be used in environments where deterministic builds are desired, -such as in CI pipelines.

+such as in CI pipelines.

+
--offline
-
Prevents Cargo from accessing the network for any reason. Without this +

Prevents Cargo from accessing the network for any reason. Without this flag, Cargo will stop with an error if it needs to access the network and the network is not available. With this flag, Cargo will attempt to proceed without the network if possible.

@@ -214,15 +240,17 @@ mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. See the cargo-fetch(1) command to download dependencies before going offline.

-

May also be specified with the net.offline config value.

+

May also be specified with the net.offline config value.

+
--frozen
-
Equivalent to specifying both --locked and --offline.
+

Equivalent to specifying both --locked and --offline.

+
--lockfile-path PATH
-
Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with +

Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with Cargo.lock (e.g. --lockfile-path /tmp/temporary-lockfile/Cargo.lock). Note that providing --lockfile-path will ignore existing lockfile at the default path, and instead will either use the lockfile from PATH, or write a new lockfile into the provided PATH if it doesn’t exist. @@ -230,7 +258,8 @@ This flag can be used to run most commands in read-only directories, writing loc

This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#14421).

+#14421).

+
@@ -239,37 +268,42 @@ requires the -Z unstable-options flag to enable (see
+toolchain
-
If Cargo has been installed with rustup, and the first argument to cargo +

If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

+for more information about how toolchain overrides work.

+
--config KEY=VALUE or PATH
-
Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

+See the command-line overrides section for more information.

+
-C PATH
-
Changes the current working directory before executing any specified operations. This affects +

Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

+#10098).

+
-h
--help
-
Prints help information.
+

Prints help information.

+
-Z flag
-
Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
+

Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

+
diff --git a/src/doc/src/commands/cargo-bench.md b/src/doc/src/commands/cargo-bench.md index 0a0f24dcfab..0994e76911f 100644 --- a/src/doc/src/commands/cargo-bench.md +++ b/src/doc/src/commands/cargo-bench.md @@ -67,14 +67,16 @@ relative paths, regardless from where `cargo bench` was executed from.
--no-run
-
Compile, but don’t run benchmarks.
+

Compile, but don’t run benchmarks.

+
--no-fail-fast
-
Run all benchmarks regardless of failure. Without this flag, Cargo will exit +

Run all benchmarks regardless of failure. Without this flag, Cargo will exit after the first executable fails. The Rust test harness will run all benchmarks within the executable to completion, this flag only applies to the executable -as a whole.

+as a whole.

+
@@ -96,27 +98,31 @@ virtual workspace will include all workspace members (equivalent to passing
-p spec
--package spec
-
Benchmark only the specified packages. See cargo-pkgid(1) for the +

Benchmark only the specified packages. See cargo-pkgid(1) for the SPEC format. This flag may be specified multiple times and supports common Unix glob patterns like *, ? and []. However, to avoid your shell accidentally expanding glob patterns before Cargo handles them, you must use single quotes or -double quotes around each pattern.

+double quotes around each pattern.

+
--workspace
-
Benchmark all members in the workspace.
+

Benchmark all members in the workspace.

+
--all
-
Deprecated alias for --workspace.
+

Deprecated alias for --workspace.

+
--exclude SPEC
-
Exclude the specified packages. Must be used in conjunction with the +

Exclude the specified packages. Must be used in conjunction with the --workspace flag. This flag may be specified multiple times and supports common Unix glob patterns like *, ? and []. However, to avoid your shell accidentally expanding glob patterns before Cargo handles them, you must use -single quotes or double quotes around each pattern.

+single quotes or double quotes around each pattern.

+ @@ -166,59 +172,69 @@ use single quotes or double quotes around each glob pattern.
--lib
-
Benchmark the package’s library.
+

Benchmark the package’s library.

+
--bin name
-
Benchmark the specified binary. This flag may be specified multiple times -and supports common Unix glob patterns.
+

Benchmark the specified binary. This flag may be specified multiple times +and supports common Unix glob patterns.

+
--bins
-
Benchmark all binary targets.
+

Benchmark all binary targets.

+
--example name
-
Benchmark the specified example. This flag may be specified multiple times -and supports common Unix glob patterns.
+

Benchmark the specified example. This flag may be specified multiple times +and supports common Unix glob patterns.

+
--examples
-
Benchmark all example targets.
+

Benchmark all example targets.

+
--test name
-
Benchmark the specified integration test. This flag may be specified -multiple times and supports common Unix glob patterns.
+

Benchmark the specified integration test. This flag may be specified +multiple times and supports common Unix glob patterns.

+
--tests
-
Benchmark all targets that have the test = true manifest +

Benchmark all targets that have the test = true manifest flag set. By default this includes the library and binaries built as unittests, and integration tests. Be aware that this will also build any required dependencies, so the lib target may be built twice (once as a unittest, and once as a dependency for binaries, integration tests, etc.). Targets may be enabled or disabled by setting the test flag in the -manifest settings for the target.

+manifest settings for the target.

+
--bench name
-
Benchmark the specified benchmark. This flag may be specified multiple -times and supports common Unix glob patterns.
+

Benchmark the specified benchmark. This flag may be specified multiple +times and supports common Unix glob patterns.

+
--benches
-
Benchmark all targets that have the bench = true +

Benchmark all targets that have the bench = true manifest flag set. By default this includes the library and binaries built as benchmarks, and bench targets. Be aware that this will also build any required dependencies, so the lib target may be built twice (once as a benchmark, and once as a dependency for binaries, benchmarks, etc.). Targets may be enabled or disabled by setting the bench flag in the -manifest settings for the target.

+manifest settings for the target.

+
--all-targets
-
Benchmark all targets. This is equivalent to specifying --lib --bins --tests --benches --examples.
+

Benchmark all targets. This is equivalent to specifying --lib --bins --tests --benches --examples.

+
@@ -236,17 +252,20 @@ for more details.
-F features
--features features
-
Space or comma separated list of features to activate. Features of workspace +

Space or comma separated list of features to activate. Features of workspace members may be enabled with package-name/feature-name syntax. This flag may -be specified multiple times, which enables all specified features.

+be specified multiple times, which enables all specified features.

+
--all-features
-
Activate all available features of all selected packages.
+

Activate all available features of all selected packages.

+
--no-default-features
-
Do not activate the default feature of the selected packages.
+

Do not activate the default feature of the selected packages.

+
@@ -256,7 +275,7 @@ be specified multiple times, which enables all specified features.
--target triple
-
Benchmark for the specified target architecture. Flag may be specified multiple times. The default is the host architecture. The general format of the triple is +

Benchmark for the specified target architecture. Flag may be specified multiple times. The default is the host architecture. The general format of the triple is <arch><sub>-<vendor>-<sys>-<abi>.

Possible values:

This may also be specified with the build.target config value.

Note that specifying this flag makes Cargo run in a different mode where the target artifacts are placed in a separate directory. See the -build cache documentation for more details. +build cache documentation for more details.

+
--profile name
-
Benchmark with the given profile. -See the reference for more details on profiles.
+

Benchmark with the given profile. +See the reference for more details on profiles.

+
--timings=fmts
-
Output information how long each compilation takes, and track concurrency +

Output information how long each compilation takes, and track concurrency information over time. Accepts an optional comma-separated list of output formats; --timings without an argument will default to --timings=html. Specifying an output format (rather than the default) is unstable and requires @@ -289,7 +310,8 @@ to look at older runs. HTML output is suitable for human consumption only, and does not provide machine-readable timing data.

  • json (unstable, requires -Zunstable-options): Emit machine-readable JSON information about timing information.
  • -
    + + @@ -299,10 +321,11 @@ information about timing information.
    --target-dir directory
    -
    Directory for all generated artifacts and intermediate files. May also be +

    Directory for all generated artifacts and intermediate files. May also be specified with the CARGO_TARGET_DIR environment variable, or the build.target-dir config value. -Defaults to target in the root of the workspace.

    +Defaults to target in the root of the workspace.

    +
    @@ -318,21 +341,23 @@ passing `--no-capture` to the benchmark binaries:
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    May also be specified with the term.color -config value.

    +config value.

    +
    --message-format fmt
    -
    The output format for diagnostic messages. Can be specified multiple times +

    The output format for diagnostic messages. Can be specified multiple times and consists of comma-separated values. Valid values:

    + +
    @@ -372,16 +399,18 @@ coming from rustc are still emitted. Cannot be used with human or <
    --manifest-path path
    -
    Path to the Cargo.toml file. By default, Cargo searches for the -Cargo.toml file in the current directory or any parent directory.
    +

    Path to the Cargo.toml file. By default, Cargo searches for the +Cargo.toml file in the current directory or any parent directory.

    +
    --ignore-rust-version
    -
    Ignore rust-version specification in packages.
    +

    Ignore rust-version specification in packages.

    +
    --locked
    -
    Asserts that the exact same dependencies and versions are used as when the +

    Asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of the following scenarios arises:

    It may be used in environments where deterministic builds are desired, -such as in CI pipelines.

    +such as in CI pipelines.

    +
    --offline
    -
    Prevents Cargo from accessing the network for any reason. Without this +

    Prevents Cargo from accessing the network for any reason. Without this flag, Cargo will stop with an error if it needs to access the network and the network is not available. With this flag, Cargo will attempt to proceed without the network if possible.

    @@ -402,15 +432,17 @@ mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. See the cargo-fetch(1) command to download dependencies before going offline.

    -

    May also be specified with the net.offline config value.

    +

    May also be specified with the net.offline config value.

    +
    --frozen
    -
    Equivalent to specifying both --locked and --offline.
    +

    Equivalent to specifying both --locked and --offline.

    +
    --lockfile-path PATH
    -
    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with +

    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with Cargo.lock (e.g. --lockfile-path /tmp/temporary-lockfile/Cargo.lock). Note that providing --lockfile-path will ignore existing lockfile at the default path, and instead will either use the lockfile from PATH, or write a new lockfile into the provided PATH if it doesn’t exist. @@ -418,7 +450,8 @@ This flag can be used to run most commands in read-only directories, writing loc

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#14421).

    +#14421).

    +
    @@ -427,37 +460,42 @@ requires the -Z unstable-options flag to enable (see
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    @@ -471,12 +509,13 @@ Rust test harness runs benchmarks serially in a single thread.
    -j N
    --jobs N
    -
    Number of parallel jobs to run. May also be specified with the +

    Number of parallel jobs to run. May also be specified with the build.jobs config value. Defaults to the number of logical CPUs. If negative, it sets the maximum number of parallel jobs to the number of logical CPUs plus provided value. If a string default is provided, it sets the value back to defaults. -Should not be 0.

    +Should not be 0.

    +
    diff --git a/src/doc/src/commands/cargo-build.md b/src/doc/src/commands/cargo-build.md index c6b82bee6b0..c072b054930 100644 --- a/src/doc/src/commands/cargo-build.md +++ b/src/doc/src/commands/cargo-build.md @@ -30,27 +30,31 @@ virtual workspace will include all workspace members (equivalent to passing
    -p spec
    --package spec
    -
    Build only the specified packages. See cargo-pkgid(1) for the +

    Build only the specified packages. See cargo-pkgid(1) for the SPEC format. This flag may be specified multiple times and supports common Unix glob patterns like *, ? and []. However, to avoid your shell accidentally expanding glob patterns before Cargo handles them, you must use single quotes or -double quotes around each pattern.

    +double quotes around each pattern.

    +
    --workspace
    -
    Build all members in the workspace.
    +

    Build all members in the workspace.

    +
    --all
    -
    Deprecated alias for --workspace.
    +

    Deprecated alias for --workspace.

    +
    --exclude SPEC
    -
    Exclude the specified packages. Must be used in conjunction with the +

    Exclude the specified packages. Must be used in conjunction with the --workspace flag. This flag may be specified multiple times and supports common Unix glob patterns like *, ? and []. However, to avoid your shell accidentally expanding glob patterns before Cargo handles them, you must use -single quotes or double quotes around each pattern.

    +single quotes or double quotes around each pattern.

    + @@ -81,59 +85,69 @@ use single quotes or double quotes around each glob pattern.
    --lib
    -
    Build the package’s library.
    +

    Build the package’s library.

    +
    --bin name
    -
    Build the specified binary. This flag may be specified multiple times -and supports common Unix glob patterns.
    +

    Build the specified binary. This flag may be specified multiple times +and supports common Unix glob patterns.

    +
    --bins
    -
    Build all binary targets.
    +

    Build all binary targets.

    +
    --example name
    -
    Build the specified example. This flag may be specified multiple times -and supports common Unix glob patterns.
    +

    Build the specified example. This flag may be specified multiple times +and supports common Unix glob patterns.

    +
    --examples
    -
    Build all example targets.
    +

    Build all example targets.

    +
    --test name
    -
    Build the specified integration test. This flag may be specified -multiple times and supports common Unix glob patterns.
    +

    Build the specified integration test. This flag may be specified +multiple times and supports common Unix glob patterns.

    +
    --tests
    -
    Build all targets that have the test = true manifest +

    Build all targets that have the test = true manifest flag set. By default this includes the library and binaries built as unittests, and integration tests. Be aware that this will also build any required dependencies, so the lib target may be built twice (once as a unittest, and once as a dependency for binaries, integration tests, etc.). Targets may be enabled or disabled by setting the test flag in the -manifest settings for the target.

    +manifest settings for the target.

    +
    --bench name
    -
    Build the specified benchmark. This flag may be specified multiple -times and supports common Unix glob patterns.
    +

    Build the specified benchmark. This flag may be specified multiple +times and supports common Unix glob patterns.

    +
    --benches
    -
    Build all targets that have the bench = true +

    Build all targets that have the bench = true manifest flag set. By default this includes the library and binaries built as benchmarks, and bench targets. Be aware that this will also build any required dependencies, so the lib target may be built twice (once as a benchmark, and once as a dependency for binaries, benchmarks, etc.). Targets may be enabled or disabled by setting the bench flag in the -manifest settings for the target.

    +manifest settings for the target.

    +
    --all-targets
    -
    Build all targets. This is equivalent to specifying --lib --bins --tests --benches --examples.
    +

    Build all targets. This is equivalent to specifying --lib --bins --tests --benches --examples.

    +
    @@ -151,17 +165,20 @@ for more details.
    -F features
    --features features
    -
    Space or comma separated list of features to activate. Features of workspace +

    Space or comma separated list of features to activate. Features of workspace members may be enabled with package-name/feature-name syntax. This flag may -be specified multiple times, which enables all specified features.

    +be specified multiple times, which enables all specified features.

    +
    --all-features
    -
    Activate all available features of all selected packages.
    +

    Activate all available features of all selected packages.

    +
    --no-default-features
    -
    Do not activate the default feature of the selected packages.
    +

    Do not activate the default feature of the selected packages.

    +
    @@ -171,7 +188,7 @@ be specified multiple times, which enables all specified features.
    --target triple
    -
    Build for the specified target architecture. Flag may be specified multiple times. The default is the host architecture. The general format of the triple is +

    Build for the specified target architecture. Flag may be specified multiple times. The default is the host architecture. The general format of the triple is <arch><sub>-<vendor>-<sys>-<abi>.

    Possible values:

    This may also be specified with the build.target config value.

    Note that specifying this flag makes Cargo run in a different mode where the target artifacts are placed in a separate directory. See the -build cache documentation for more details. +build cache documentation for more details.

    +
    -r
    --release
    -
    Build optimized artifacts with the release profile. -See also the --profile option for choosing a specific profile by name.
    +

    Build optimized artifacts with the release profile. +See also the --profile option for choosing a specific profile by name.

    +
    --profile name
    -
    Build with the given profile. -See the reference for more details on profiles.
    +

    Build with the given profile. +See the reference for more details on profiles.

    +
    --timings=fmts
    -
    Output information how long each compilation takes, and track concurrency +

    Output information how long each compilation takes, and track concurrency information over time. Accepts an optional comma-separated list of output formats; --timings without an argument will default to --timings=html. Specifying an output format (rather than the default) is unstable and requires @@ -210,7 +230,8 @@ to look at older runs. HTML output is suitable for human consumption only, and does not provide machine-readable timing data.

  • json (unstable, requires -Zunstable-options): Emit machine-readable JSON information about timing information.
  • -
    + + @@ -220,18 +241,20 @@ information about timing information.
    --target-dir directory
    -
    Directory for all generated artifacts and intermediate files. May also be +

    Directory for all generated artifacts and intermediate files. May also be specified with the CARGO_TARGET_DIR environment variable, or the build.target-dir config value. -Defaults to target in the root of the workspace.

    +Defaults to target in the root of the workspace.

    +
    --artifact-dir directory
    -
    Copy final artifacts to this directory.

    +

    Copy final artifacts to this directory.

    This option is unstable and available only on the nightly channel and requires the -Z unstable-options flag to enable. -See https://github.com/rust-lang/cargo/issues/6790 for more information.

    +See https://github.com/rust-lang/cargo/issues/6790 for more information.

    +
    @@ -241,21 +264,23 @@ See https://github.com/
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    • auto (default): Automatically detect if color support is available on the terminal.
    • @@ -263,11 +288,12 @@ terminal.
    • never: Never display colors.

    May also be specified with the term.color -config value.

    +config value.

    +
    --message-format fmt
    -
    The output format for diagnostic messages. Can be specified multiple times +

    The output format for diagnostic messages. Can be specified multiple times and consists of comma-separated values. Valid values:

    • human (default): Display in a human-readable text format. Conflicts with @@ -286,16 +312,18 @@ scheme. Cannot be used with human or short.
    • in JSON messages printed, but instead Cargo itself should render the JSON diagnostics coming from rustc. Cargo’s own JSON diagnostics and others coming from rustc are still emitted. Cannot be used with human or short. -
    + +
    --build-plan
    -
    Outputs a series of JSON messages to stdout that indicate the commands to run +

    Outputs a series of JSON messages to stdout that indicate the commands to run the build.

    This option is unstable and available only on the nightly channel and requires the -Z unstable-options flag to enable. -See https://github.com/rust-lang/cargo/issues/5579 for more information.

    +See https://github.com/rust-lang/cargo/issues/5579 for more information.

    +
    @@ -303,16 +331,18 @@ See https://github.com/
    --manifest-path path
    -
    Path to the Cargo.toml file. By default, Cargo searches for the -Cargo.toml file in the current directory or any parent directory.
    +

    Path to the Cargo.toml file. By default, Cargo searches for the +Cargo.toml file in the current directory or any parent directory.

    +
    --ignore-rust-version
    -
    Ignore rust-version specification in packages.
    +

    Ignore rust-version specification in packages.

    +
    --locked
    -
    Asserts that the exact same dependencies and versions are used as when the +

    Asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of the following scenarios arises:

      @@ -320,11 +350,12 @@ error when either of the following scenarios arises:

    • Cargo attempted to change the lock file due to a different dependency resolution.

    It may be used in environments where deterministic builds are desired, -such as in CI pipelines.

    +such as in CI pipelines.

    +
    --offline
    -
    Prevents Cargo from accessing the network for any reason. Without this +

    Prevents Cargo from accessing the network for any reason. Without this flag, Cargo will stop with an error if it needs to access the network and the network is not available. With this flag, Cargo will attempt to proceed without the network if possible.

    @@ -333,15 +364,17 @@ mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. See the cargo-fetch(1) command to download dependencies before going offline.

    -

    May also be specified with the net.offline config value.

    +

    May also be specified with the net.offline config value.

    +
    --frozen
    -
    Equivalent to specifying both --locked and --offline.
    +

    Equivalent to specifying both --locked and --offline.

    +
    --lockfile-path PATH
    -
    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with +

    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with Cargo.lock (e.g. --lockfile-path /tmp/temporary-lockfile/Cargo.lock). Note that providing --lockfile-path will ignore existing lockfile at the default path, and instead will either use the lockfile from PATH, or write a new lockfile into the provided PATH if it doesn’t exist. @@ -349,7 +382,8 @@ This flag can be used to run most commands in read-only directories, writing loc

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#14421).

    +#14421).

    +
    @@ -358,37 +392,42 @@ requires the -Z unstable-options flag to enable (see
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    @@ -398,26 +437,29 @@ requires the -Z unstable-options flag to enable (see
    -j N
    --jobs N
    -
    Number of parallel jobs to run. May also be specified with the +

    Number of parallel jobs to run. May also be specified with the build.jobs config value. Defaults to the number of logical CPUs. If negative, it sets the maximum number of parallel jobs to the number of logical CPUs plus provided value. If a string default is provided, it sets the value back to defaults. -Should not be 0.

    +Should not be 0.

    +
    --keep-going
    -
    Build as many crates in the dependency graph as possible, rather than aborting +

    Build as many crates in the dependency graph as possible, rather than aborting the build on the first one that fails to build.

    For example if the current package depends on dependencies fails and works, one of which fails to build, cargo build -j1 may or may not build the one that succeeds (depending on which one of the two builds Cargo picked to run first), whereas cargo build -j1 --keep-going would definitely run both -builds, even if the one run first fails.

    +builds, even if the one run first fails.

    +
    --future-incompat-report
    -
    Displays a future-incompat report for any future-incompatible warnings +

    Displays a future-incompat report for any future-incompatible warnings produced during execution of this command

    -

    See cargo-report(1)

    +

    See cargo-report(1)

    +
    diff --git a/src/doc/src/commands/cargo-check.md b/src/doc/src/commands/cargo-check.md index 158c4f75e7f..56292de3c02 100644 --- a/src/doc/src/commands/cargo-check.md +++ b/src/doc/src/commands/cargo-check.md @@ -35,27 +35,31 @@ virtual workspace will include all workspace members (equivalent to passing
    -p spec
    --package spec
    -
    Check only the specified packages. See cargo-pkgid(1) for the +

    Check only the specified packages. See cargo-pkgid(1) for the SPEC format. This flag may be specified multiple times and supports common Unix glob patterns like *, ? and []. However, to avoid your shell accidentally expanding glob patterns before Cargo handles them, you must use single quotes or -double quotes around each pattern.

    +double quotes around each pattern.

    +
    --workspace
    -
    Check all members in the workspace.
    +

    Check all members in the workspace.

    +
    --all
    -
    Deprecated alias for --workspace.
    +

    Deprecated alias for --workspace.

    +
    --exclude SPEC
    -
    Exclude the specified packages. Must be used in conjunction with the +

    Exclude the specified packages. Must be used in conjunction with the --workspace flag. This flag may be specified multiple times and supports common Unix glob patterns like *, ? and []. However, to avoid your shell accidentally expanding glob patterns before Cargo handles them, you must use -single quotes or double quotes around each pattern.

    +single quotes or double quotes around each pattern.

    +
    @@ -77,59 +81,69 @@ use single quotes or double quotes around each glob pattern.
    --lib
    -
    Check the package’s library.
    +

    Check the package’s library.

    +
    --bin name
    -
    Check the specified binary. This flag may be specified multiple times -and supports common Unix glob patterns.
    +

    Check the specified binary. This flag may be specified multiple times +and supports common Unix glob patterns.

    +
    --bins
    -
    Check all binary targets.
    +

    Check all binary targets.

    +
    --example name
    -
    Check the specified example. This flag may be specified multiple times -and supports common Unix glob patterns.
    +

    Check the specified example. This flag may be specified multiple times +and supports common Unix glob patterns.

    +
    --examples
    -
    Check all example targets.
    +

    Check all example targets.

    +
    --test name
    -
    Check the specified integration test. This flag may be specified -multiple times and supports common Unix glob patterns.
    +

    Check the specified integration test. This flag may be specified +multiple times and supports common Unix glob patterns.

    +
    --tests
    -
    Check all targets that have the test = true manifest +

    Check all targets that have the test = true manifest flag set. By default this includes the library and binaries built as unittests, and integration tests. Be aware that this will also build any required dependencies, so the lib target may be built twice (once as a unittest, and once as a dependency for binaries, integration tests, etc.). Targets may be enabled or disabled by setting the test flag in the -manifest settings for the target.

    +manifest settings for the target.

    +
    --bench name
    -
    Check the specified benchmark. This flag may be specified multiple -times and supports common Unix glob patterns.
    +

    Check the specified benchmark. This flag may be specified multiple +times and supports common Unix glob patterns.

    +
    --benches
    -
    Check all targets that have the bench = true +

    Check all targets that have the bench = true manifest flag set. By default this includes the library and binaries built as benchmarks, and bench targets. Be aware that this will also build any required dependencies, so the lib target may be built twice (once as a benchmark, and once as a dependency for binaries, benchmarks, etc.). Targets may be enabled or disabled by setting the bench flag in the -manifest settings for the target.

    +manifest settings for the target.

    +
    --all-targets
    -
    Check all targets. This is equivalent to specifying --lib --bins --tests --benches --examples.
    +

    Check all targets. This is equivalent to specifying --lib --bins --tests --benches --examples.

    +
    @@ -147,17 +161,20 @@ for more details.
    -F features
    --features features
    -
    Space or comma separated list of features to activate. Features of workspace +

    Space or comma separated list of features to activate. Features of workspace members may be enabled with package-name/feature-name syntax. This flag may -be specified multiple times, which enables all specified features.

    +be specified multiple times, which enables all specified features.

    +
    --all-features
    -
    Activate all available features of all selected packages.
    +

    Activate all available features of all selected packages.

    +
    --no-default-features
    -
    Do not activate the default feature of the selected packages.
    +

    Do not activate the default feature of the selected packages.

    +
    @@ -167,7 +184,7 @@ be specified multiple times, which enables all specified features.
    --target triple
    -
    Check for the specified target architecture. Flag may be specified multiple times. The default is the host architecture. The general format of the triple is +

    Check for the specified target architecture. Flag may be specified multiple times. The default is the host architecture. The general format of the triple is <arch><sub>-<vendor>-<sys>-<abi>.

    Possible values:

    This may also be specified with the build.target config value.

    Note that specifying this flag makes Cargo run in a different mode where the target artifacts are placed in a separate directory. See the -build cache documentation for more details. +build cache documentation for more details.

    +
    -r
    --release
    -
    Check optimized artifacts with the release profile. -See also the --profile option for choosing a specific profile by name.
    +

    Check optimized artifacts with the release profile. +See also the --profile option for choosing a specific profile by name.

    +
    --profile name
    -
    Check with the given profile.

    +

    Check with the given profile.

    As a special case, specifying the test profile will also enable checking in test mode which will enable checking tests and enable the test cfg option. See rustc tests for more detail.

    -

    See the reference for more details on profiles.

    +

    See the reference for more details on profiles.

    +
    --timings=fmts
    -
    Output information how long each compilation takes, and track concurrency +

    Output information how long each compilation takes, and track concurrency information over time. Accepts an optional comma-separated list of output formats; --timings without an argument will default to --timings=html. Specifying an output format (rather than the default) is unstable and requires @@ -210,7 +230,8 @@ to look at older runs. HTML output is suitable for human consumption only, and does not provide machine-readable timing data.

  • json (unstable, requires -Zunstable-options): Emit machine-readable JSON information about timing information.
  • -
    + + @@ -220,10 +241,11 @@ information about timing information.
    --target-dir directory
    -
    Directory for all generated artifacts and intermediate files. May also be +

    Directory for all generated artifacts and intermediate files. May also be specified with the CARGO_TARGET_DIR environment variable, or the build.target-dir config value. -Defaults to target in the root of the workspace.

    +Defaults to target in the root of the workspace.

    +
    @@ -232,21 +254,23 @@ Defaults to target in the root of the workspace.
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    • auto (default): Automatically detect if color support is available on the terminal.
    • @@ -254,11 +278,12 @@ terminal.
    • never: Never display colors.

    May also be specified with the term.color -config value.

    +config value.

    +
    --message-format fmt
    -
    The output format for diagnostic messages. Can be specified multiple times +

    The output format for diagnostic messages. Can be specified multiple times and consists of comma-separated values. Valid values:

    • human (default): Display in a human-readable text format. Conflicts with @@ -277,7 +302,8 @@ scheme. Cannot be used with human or short.
    • in JSON messages printed, but instead Cargo itself should render the JSON diagnostics coming from rustc. Cargo’s own JSON diagnostics and others coming from rustc are still emitted. Cannot be used with human or short. -
    + +
    @@ -285,16 +311,18 @@ coming from rustc are still emitted. Cannot be used with human or <
    --manifest-path path
    -
    Path to the Cargo.toml file. By default, Cargo searches for the -Cargo.toml file in the current directory or any parent directory.
    +

    Path to the Cargo.toml file. By default, Cargo searches for the +Cargo.toml file in the current directory or any parent directory.

    +
    --ignore-rust-version
    -
    Ignore rust-version specification in packages.
    +

    Ignore rust-version specification in packages.

    +
    --locked
    -
    Asserts that the exact same dependencies and versions are used as when the +

    Asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of the following scenarios arises:

      @@ -302,11 +330,12 @@ error when either of the following scenarios arises:

    • Cargo attempted to change the lock file due to a different dependency resolution.

    It may be used in environments where deterministic builds are desired, -such as in CI pipelines.

    +such as in CI pipelines.

    +
    --offline
    -
    Prevents Cargo from accessing the network for any reason. Without this +

    Prevents Cargo from accessing the network for any reason. Without this flag, Cargo will stop with an error if it needs to access the network and the network is not available. With this flag, Cargo will attempt to proceed without the network if possible.

    @@ -315,15 +344,17 @@ mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. See the cargo-fetch(1) command to download dependencies before going offline.

    -

    May also be specified with the net.offline config value.

    +

    May also be specified with the net.offline config value.

    +
    --frozen
    -
    Equivalent to specifying both --locked and --offline.
    +

    Equivalent to specifying both --locked and --offline.

    +
    --lockfile-path PATH
    -
    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with +

    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with Cargo.lock (e.g. --lockfile-path /tmp/temporary-lockfile/Cargo.lock). Note that providing --lockfile-path will ignore existing lockfile at the default path, and instead will either use the lockfile from PATH, or write a new lockfile into the provided PATH if it doesn’t exist. @@ -331,7 +362,8 @@ This flag can be used to run most commands in read-only directories, writing loc

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#14421).

    +#14421).

    +
    @@ -340,37 +372,42 @@ requires the -Z unstable-options flag to enable (see
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    @@ -380,26 +417,29 @@ requires the -Z unstable-options flag to enable (see
    -j N
    --jobs N
    -
    Number of parallel jobs to run. May also be specified with the +

    Number of parallel jobs to run. May also be specified with the build.jobs config value. Defaults to the number of logical CPUs. If negative, it sets the maximum number of parallel jobs to the number of logical CPUs plus provided value. If a string default is provided, it sets the value back to defaults. -Should not be 0.

    +Should not be 0.

    +
    --keep-going
    -
    Build as many crates in the dependency graph as possible, rather than aborting +

    Build as many crates in the dependency graph as possible, rather than aborting the build on the first one that fails to build.

    For example if the current package depends on dependencies fails and works, one of which fails to build, cargo check -j1 may or may not build the one that succeeds (depending on which one of the two builds Cargo picked to run first), whereas cargo check -j1 --keep-going would definitely run both -builds, even if the one run first fails.

    +builds, even if the one run first fails.

    +
    --future-incompat-report
    -
    Displays a future-incompat report for any future-incompatible warnings +

    Displays a future-incompat report for any future-incompatible warnings produced during execution of this command

    -

    See cargo-report(1)

    +

    See cargo-report(1)

    +
    diff --git a/src/doc/src/commands/cargo-clean.md b/src/doc/src/commands/cargo-clean.md index cc24f7b3119..8fe0a64c339 100644 --- a/src/doc/src/commands/cargo-clean.md +++ b/src/doc/src/commands/cargo-clean.md @@ -24,8 +24,9 @@ workspace are cleaned.
    -p spec
    --package spec
    -
    Clean only the specified packages. This flag may be specified -multiple times. See cargo-pkgid(1) for the SPEC format.
    +

    Clean only the specified packages. This flag may be specified +multiple times. See cargo-pkgid(1) for the SPEC format.

    +
    @@ -34,32 +35,37 @@ multiple times. See cargo-pkgid(1) for the SPEC f
    --dry-run
    -
    Displays a summary of what would be deleted without deleting anything. -Use with --verbose to display the actual files that would be deleted.
    +

    Displays a summary of what would be deleted without deleting anything. +Use with --verbose to display the actual files that would be deleted.

    +
    --doc
    -
    This option will cause cargo clean to remove only the doc directory in -the target directory.
    +

    This option will cause cargo clean to remove only the doc directory in +the target directory.

    +
    --release
    -
    Remove all artifacts in the release directory.
    +

    Remove all artifacts in the release directory.

    +
    --profile name
    -
    Remove all artifacts in the directory with the given profile name.
    +

    Remove all artifacts in the directory with the given profile name.

    +
    --target-dir directory
    -
    Directory for all generated artifacts and intermediate files. May also be +

    Directory for all generated artifacts and intermediate files. May also be specified with the CARGO_TARGET_DIR environment variable, or the build.target-dir config value. -Defaults to target in the root of the workspace.

    +Defaults to target in the root of the workspace.

    +
    --target triple
    -
    Clean for the specified target architecture. Flag may be specified multiple times. The default is the host architecture. The general format of the triple is +

    Clean for the specified target architecture. Flag may be specified multiple times. The default is the host architecture. The general format of the triple is <arch><sub>-<vendor>-<sys>-<abi>.

    Possible values:

      @@ -70,7 +76,8 @@ Defaults to target in the root of the workspace.

    This may also be specified with the build.target config value.

    Note that specifying this flag makes Cargo run in a different mode where the target artifacts are placed in a separate directory. See the -build cache documentation for more details. +build cache documentation for more details.

    +
    @@ -80,21 +87,23 @@ target artifacts are placed in a separate directory. See the
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    • auto (default): Automatically detect if color support is available on the terminal.
    • @@ -102,7 +111,8 @@ terminal.
    • never: Never display colors.

    May also be specified with the term.color -config value.

    +config value.

    +
    @@ -110,12 +120,13 @@ terminal.
    --manifest-path path
    -
    Path to the Cargo.toml file. By default, Cargo searches for the -Cargo.toml file in the current directory or any parent directory.
    +

    Path to the Cargo.toml file. By default, Cargo searches for the +Cargo.toml file in the current directory or any parent directory.

    +
    --locked
    -
    Asserts that the exact same dependencies and versions are used as when the +

    Asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of the following scenarios arises:

      @@ -123,11 +134,12 @@ error when either of the following scenarios arises:

    • Cargo attempted to change the lock file due to a different dependency resolution.

    It may be used in environments where deterministic builds are desired, -such as in CI pipelines.

    +such as in CI pipelines.

    +
    --offline
    -
    Prevents Cargo from accessing the network for any reason. Without this +

    Prevents Cargo from accessing the network for any reason. Without this flag, Cargo will stop with an error if it needs to access the network and the network is not available. With this flag, Cargo will attempt to proceed without the network if possible.

    @@ -136,15 +148,17 @@ mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. See the cargo-fetch(1) command to download dependencies before going offline.

    -

    May also be specified with the net.offline config value.

    +

    May also be specified with the net.offline config value.

    +
    --frozen
    -
    Equivalent to specifying both --locked and --offline.
    +

    Equivalent to specifying both --locked and --offline.

    +
    --lockfile-path PATH
    -
    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with +

    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with Cargo.lock (e.g. --lockfile-path /tmp/temporary-lockfile/Cargo.lock). Note that providing --lockfile-path will ignore existing lockfile at the default path, and instead will either use the lockfile from PATH, or write a new lockfile into the provided PATH if it doesn’t exist. @@ -152,7 +166,8 @@ This flag can be used to run most commands in read-only directories, writing loc

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#14421).

    +#14421).

    +
    @@ -161,37 +176,42 @@ requires the -Z unstable-options flag to enable (see
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    diff --git a/src/doc/src/commands/cargo-doc.md b/src/doc/src/commands/cargo-doc.md index 0afb4f81052..6e4600c84bd 100644 --- a/src/doc/src/commands/cargo-doc.md +++ b/src/doc/src/commands/cargo-doc.md @@ -21,18 +21,21 @@ is placed in `target/doc` in rustdoc's usual format.
    --open
    -
    Open the docs in a browser after building them. This will use your default +

    Open the docs in a browser after building them. This will use your default browser unless you define another one in the BROWSER environment variable or use the doc.browser configuration -option.

    +option.

    +
    --no-deps
    -
    Do not build documentation for dependencies.
    +

    Do not build documentation for dependencies.

    +
    --document-private-items
    -
    Include non-public items in the documentation. This will be enabled by default if documenting a binary target.
    +

    Include non-public items in the documentation. This will be enabled by default if documenting a binary target.

    +
    @@ -54,27 +57,31 @@ virtual workspace will include all workspace members (equivalent to passing
    -p spec
    --package spec
    -
    Document only the specified packages. See cargo-pkgid(1) for the +

    Document only the specified packages. See cargo-pkgid(1) for the SPEC format. This flag may be specified multiple times and supports common Unix glob patterns like *, ? and []. However, to avoid your shell accidentally expanding glob patterns before Cargo handles them, you must use single quotes or -double quotes around each pattern.

    +double quotes around each pattern.

    +
    --workspace
    -
    Document all members in the workspace.
    +

    Document all members in the workspace.

    +
    --all
    -
    Deprecated alias for --workspace.
    +

    Deprecated alias for --workspace.

    +
    --exclude SPEC
    -
    Exclude the specified packages. Must be used in conjunction with the +

    Exclude the specified packages. Must be used in conjunction with the --workspace flag. This flag may be specified multiple times and supports common Unix glob patterns like *, ? and []. However, to avoid your shell accidentally expanding glob patterns before Cargo handles them, you must use -single quotes or double quotes around each pattern.

    +single quotes or double quotes around each pattern.

    +
    @@ -92,25 +99,30 @@ flag and will always document the given target.
    --lib
    -
    Document the package’s library.
    +

    Document the package’s library.

    +
    --bin name
    -
    Document the specified binary. This flag may be specified multiple times -and supports common Unix glob patterns.
    +

    Document the specified binary. This flag may be specified multiple times +and supports common Unix glob patterns.

    +
    --bins
    -
    Document all binary targets.
    +

    Document all binary targets.

    +
    --example name
    -
    Document the specified example. This flag may be specified multiple times -and supports common Unix glob patterns.
    +

    Document the specified example. This flag may be specified multiple times +and supports common Unix glob patterns.

    +
    --examples
    -
    Document all example targets.
    +

    Document all example targets.

    +
    @@ -128,17 +140,20 @@ for more details.
    -F features
    --features features
    -
    Space or comma separated list of features to activate. Features of workspace +

    Space or comma separated list of features to activate. Features of workspace members may be enabled with package-name/feature-name syntax. This flag may -be specified multiple times, which enables all specified features.

    +be specified multiple times, which enables all specified features.

    +
    --all-features
    -
    Activate all available features of all selected packages.
    +

    Activate all available features of all selected packages.

    +
    --no-default-features
    -
    Do not activate the default feature of the selected packages.
    +

    Do not activate the default feature of the selected packages.

    +
    @@ -148,7 +163,7 @@ be specified multiple times, which enables all specified features.
    --target triple
    -
    Document for the specified target architecture. Flag may be specified multiple times. The default is the host architecture. The general format of the triple is +

    Document for the specified target architecture. Flag may be specified multiple times. The default is the host architecture. The general format of the triple is <arch><sub>-<vendor>-<sys>-<abi>.

    Possible values:

    This may also be specified with the build.target config value.

    Note that specifying this flag makes Cargo run in a different mode where the target artifacts are placed in a separate directory. See the -build cache documentation for more details. +build cache documentation for more details.

    +
    -r
    --release
    -
    Document optimized artifacts with the release profile. -See also the --profile option for choosing a specific profile by name.
    +

    Document optimized artifacts with the release profile. +See also the --profile option for choosing a specific profile by name.

    +
    --profile name
    -
    Document with the given profile. -See the reference for more details on profiles.
    +

    Document with the given profile. +See the reference for more details on profiles.

    +
    --timings=fmts
    -
    Output information how long each compilation takes, and track concurrency +

    Output information how long each compilation takes, and track concurrency information over time. Accepts an optional comma-separated list of output formats; --timings without an argument will default to --timings=html. Specifying an output format (rather than the default) is unstable and requires @@ -187,7 +205,8 @@ to look at older runs. HTML output is suitable for human consumption only, and does not provide machine-readable timing data.

  • json (unstable, requires -Zunstable-options): Emit machine-readable JSON information about timing information.
  • -
    + + @@ -197,10 +216,11 @@ information about timing information.
    --target-dir directory
    -
    Directory for all generated artifacts and intermediate files. May also be +

    Directory for all generated artifacts and intermediate files. May also be specified with the CARGO_TARGET_DIR environment variable, or the build.target-dir config value. -Defaults to target in the root of the workspace.

    +Defaults to target in the root of the workspace.

    +
    @@ -209,21 +229,23 @@ Defaults to target in the root of the workspace.
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    • auto (default): Automatically detect if color support is available on the terminal.
    • @@ -231,11 +253,12 @@ terminal.
    • never: Never display colors.

    May also be specified with the term.color -config value.

    +config value.

    +
    --message-format fmt
    -
    The output format for diagnostic messages. Can be specified multiple times +

    The output format for diagnostic messages. Can be specified multiple times and consists of comma-separated values. Valid values:

    • human (default): Display in a human-readable text format. Conflicts with @@ -254,7 +277,8 @@ scheme. Cannot be used with human or short.
    • in JSON messages printed, but instead Cargo itself should render the JSON diagnostics coming from rustc. Cargo’s own JSON diagnostics and others coming from rustc are still emitted. Cannot be used with human or short. -
    + +
    @@ -262,16 +286,18 @@ coming from rustc are still emitted. Cannot be used with human or <
    --manifest-path path
    -
    Path to the Cargo.toml file. By default, Cargo searches for the -Cargo.toml file in the current directory or any parent directory.
    +

    Path to the Cargo.toml file. By default, Cargo searches for the +Cargo.toml file in the current directory or any parent directory.

    +
    --ignore-rust-version
    -
    Ignore rust-version specification in packages.
    +

    Ignore rust-version specification in packages.

    +
    --locked
    -
    Asserts that the exact same dependencies and versions are used as when the +

    Asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of the following scenarios arises:

      @@ -279,11 +305,12 @@ error when either of the following scenarios arises:

    • Cargo attempted to change the lock file due to a different dependency resolution.

    It may be used in environments where deterministic builds are desired, -such as in CI pipelines.

    +such as in CI pipelines.

    +
    --offline
    -
    Prevents Cargo from accessing the network for any reason. Without this +

    Prevents Cargo from accessing the network for any reason. Without this flag, Cargo will stop with an error if it needs to access the network and the network is not available. With this flag, Cargo will attempt to proceed without the network if possible.

    @@ -292,15 +319,17 @@ mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. See the cargo-fetch(1) command to download dependencies before going offline.

    -

    May also be specified with the net.offline config value.

    +

    May also be specified with the net.offline config value.

    +
    --frozen
    -
    Equivalent to specifying both --locked and --offline.
    +

    Equivalent to specifying both --locked and --offline.

    +
    --lockfile-path PATH
    -
    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with +

    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with Cargo.lock (e.g. --lockfile-path /tmp/temporary-lockfile/Cargo.lock). Note that providing --lockfile-path will ignore existing lockfile at the default path, and instead will either use the lockfile from PATH, or write a new lockfile into the provided PATH if it doesn’t exist. @@ -308,7 +337,8 @@ This flag can be used to run most commands in read-only directories, writing loc

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#14421).

    +#14421).

    +
    @@ -317,37 +347,42 @@ requires the -Z unstable-options flag to enable (see
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    @@ -357,21 +392,23 @@ requires the -Z unstable-options flag to enable (see
    -j N
    --jobs N
    -
    Number of parallel jobs to run. May also be specified with the +

    Number of parallel jobs to run. May also be specified with the build.jobs config value. Defaults to the number of logical CPUs. If negative, it sets the maximum number of parallel jobs to the number of logical CPUs plus provided value. If a string default is provided, it sets the value back to defaults. -Should not be 0.

    +Should not be 0.

    +
    --keep-going
    -
    Build as many crates in the dependency graph as possible, rather than aborting +

    Build as many crates in the dependency graph as possible, rather than aborting the build on the first one that fails to build.

    For example if the current package depends on dependencies fails and works, one of which fails to build, cargo doc -j1 may or may not build the one that succeeds (depending on which one of the two builds Cargo picked to run first), whereas cargo doc -j1 --keep-going would definitely run both -builds, even if the one run first fails.

    +builds, even if the one run first fails.

    +
    diff --git a/src/doc/src/commands/cargo-fetch.md b/src/doc/src/commands/cargo-fetch.md index 81d3e5eb2dd..ba8d72a34ce 100644 --- a/src/doc/src/commands/cargo-fetch.md +++ b/src/doc/src/commands/cargo-fetch.md @@ -29,7 +29,7 @@ you plan to use Cargo without a network with the `--offline` flag.
    --target triple
    -
    Fetch for the specified target architecture. Flag may be specified multiple times. The default is all architectures. The general format of the triple is +

    Fetch for the specified target architecture. Flag may be specified multiple times. The default is all architectures. The general format of the triple is <arch><sub>-<vendor>-<sys>-<abi>.

    Possible values:

      @@ -40,7 +40,8 @@ you plan to use Cargo without a network with the `--offline` flag.

      This may also be specified with the build.target config value.

      Note that specifying this flag makes Cargo run in a different mode where the target artifacts are placed in a separate directory. See the -build cache documentation for more details.

    +build cache documentation for more details.

    +
    @@ -49,21 +50,23 @@ target artifacts are placed in a separate directory. See the
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    • auto (default): Automatically detect if color support is available on the terminal.
    • @@ -71,7 +74,8 @@ terminal.
    • never: Never display colors.

    May also be specified with the term.color -config value.

    +config value.

    +
    @@ -79,12 +83,13 @@ terminal.
    --manifest-path path
    -
    Path to the Cargo.toml file. By default, Cargo searches for the -Cargo.toml file in the current directory or any parent directory.
    +

    Path to the Cargo.toml file. By default, Cargo searches for the +Cargo.toml file in the current directory or any parent directory.

    +
    --locked
    -
    Asserts that the exact same dependencies and versions are used as when the +

    Asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of the following scenarios arises:

      @@ -92,26 +97,29 @@ error when either of the following scenarios arises:

    • Cargo attempted to change the lock file due to a different dependency resolution.

    It may be used in environments where deterministic builds are desired, -such as in CI pipelines.

    +such as in CI pipelines.

    +
    --offline
    -
    Prevents Cargo from accessing the network for any reason. Without this +

    Prevents Cargo from accessing the network for any reason. Without this flag, Cargo will stop with an error if it needs to access the network and the network is not available. With this flag, Cargo will attempt to proceed without the network if possible.

    Beware that this may result in different dependency resolution than online mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index.

    -

    May also be specified with the net.offline config value.

    +

    May also be specified with the net.offline config value.

    +
    --frozen
    -
    Equivalent to specifying both --locked and --offline.
    +

    Equivalent to specifying both --locked and --offline.

    +
    --lockfile-path PATH
    -
    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with +

    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with Cargo.lock (e.g. --lockfile-path /tmp/temporary-lockfile/Cargo.lock). Note that providing --lockfile-path will ignore existing lockfile at the default path, and instead will either use the lockfile from PATH, or write a new lockfile into the provided PATH if it doesn’t exist. @@ -119,7 +127,8 @@ This flag can be used to run most commands in read-only directories, writing loc

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#14421).

    +#14421).

    +
    @@ -128,37 +137,42 @@ requires the -Z unstable-options flag to enable (see
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    diff --git a/src/doc/src/commands/cargo-fix.md b/src/doc/src/commands/cargo-fix.md index 4f9eacf2888..5cba8433054 100644 --- a/src/doc/src/commands/cargo-fix.md +++ b/src/doc/src/commands/cargo-fix.md @@ -68,32 +68,38 @@ with the new edition.
    --broken-code
    -
    Fix code even if it already has compiler errors. This is useful if cargo fix +

    Fix code even if it already has compiler errors. This is useful if cargo fix fails to apply the changes. It will apply the changes and leave the broken -code in the working directory for you to inspect and manually fix.

    +code in the working directory for you to inspect and manually fix.

    +
    --edition
    -
    Apply changes that will update the code to the next edition. This will not +

    Apply changes that will update the code to the next edition. This will not update the edition in the Cargo.toml manifest, which must be updated -manually after cargo fix --edition has finished.

    +manually after cargo fix --edition has finished.

    +
    --edition-idioms
    -
    Apply suggestions that will update code to the preferred style for the current -edition.
    +

    Apply suggestions that will update code to the preferred style for the current +edition.

    +
    --allow-no-vcs
    -
    Fix code even if a VCS was not detected.
    +

    Fix code even if a VCS was not detected.

    +
    --allow-dirty
    -
    Fix code even if the working directory has changes (including staged changes).
    +

    Fix code even if the working directory has changes (including staged changes).

    +
    --allow-staged
    -
    Fix code even if the working directory has staged changes.
    +

    Fix code even if the working directory has staged changes.

    +
    @@ -115,27 +121,31 @@ virtual workspace will include all workspace members (equivalent to passing
    -p spec
    --package spec
    -
    Fix only the specified packages. See cargo-pkgid(1) for the +

    Fix only the specified packages. See cargo-pkgid(1) for the SPEC format. This flag may be specified multiple times and supports common Unix glob patterns like *, ? and []. However, to avoid your shell accidentally expanding glob patterns before Cargo handles them, you must use single quotes or -double quotes around each pattern.

    +double quotes around each pattern.

    +
    --workspace
    -
    Fix all members in the workspace.
    +

    Fix all members in the workspace.

    +
    --all
    -
    Deprecated alias for --workspace.
    +

    Deprecated alias for --workspace.

    +
    --exclude SPEC
    -
    Exclude the specified packages. Must be used in conjunction with the +

    Exclude the specified packages. Must be used in conjunction with the --workspace flag. This flag may be specified multiple times and supports common Unix glob patterns like *, ? and []. However, to avoid your shell accidentally expanding glob patterns before Cargo handles them, you must use -single quotes or double quotes around each pattern.

    +single quotes or double quotes around each pattern.

    +
    @@ -157,59 +167,69 @@ use single quotes or double quotes around each glob pattern.
    --lib
    -
    Fix the package’s library.
    +

    Fix the package’s library.

    +
    --bin name
    -
    Fix the specified binary. This flag may be specified multiple times -and supports common Unix glob patterns.
    +

    Fix the specified binary. This flag may be specified multiple times +and supports common Unix glob patterns.

    +
    --bins
    -
    Fix all binary targets.
    +

    Fix all binary targets.

    +
    --example name
    -
    Fix the specified example. This flag may be specified multiple times -and supports common Unix glob patterns.
    +

    Fix the specified example. This flag may be specified multiple times +and supports common Unix glob patterns.

    +
    --examples
    -
    Fix all example targets.
    +

    Fix all example targets.

    +
    --test name
    -
    Fix the specified integration test. This flag may be specified -multiple times and supports common Unix glob patterns.
    +

    Fix the specified integration test. This flag may be specified +multiple times and supports common Unix glob patterns.

    +
    --tests
    -
    Fix all targets that have the test = true manifest +

    Fix all targets that have the test = true manifest flag set. By default this includes the library and binaries built as unittests, and integration tests. Be aware that this will also build any required dependencies, so the lib target may be built twice (once as a unittest, and once as a dependency for binaries, integration tests, etc.). Targets may be enabled or disabled by setting the test flag in the -manifest settings for the target.

    +manifest settings for the target.

    +
    --bench name
    -
    Fix the specified benchmark. This flag may be specified multiple -times and supports common Unix glob patterns.
    +

    Fix the specified benchmark. This flag may be specified multiple +times and supports common Unix glob patterns.

    +
    --benches
    -
    Fix all targets that have the bench = true +

    Fix all targets that have the bench = true manifest flag set. By default this includes the library and binaries built as benchmarks, and bench targets. Be aware that this will also build any required dependencies, so the lib target may be built twice (once as a benchmark, and once as a dependency for binaries, benchmarks, etc.). Targets may be enabled or disabled by setting the bench flag in the -manifest settings for the target.

    +manifest settings for the target.

    +
    --all-targets
    -
    Fix all targets. This is equivalent to specifying --lib --bins --tests --benches --examples.
    +

    Fix all targets. This is equivalent to specifying --lib --bins --tests --benches --examples.

    +
    @@ -227,17 +247,20 @@ for more details.
    -F features
    --features features
    -
    Space or comma separated list of features to activate. Features of workspace +

    Space or comma separated list of features to activate. Features of workspace members may be enabled with package-name/feature-name syntax. This flag may -be specified multiple times, which enables all specified features.

    +be specified multiple times, which enables all specified features.

    +
    --all-features
    -
    Activate all available features of all selected packages.
    +

    Activate all available features of all selected packages.

    +
    --no-default-features
    -
    Do not activate the default feature of the selected packages.
    +

    Do not activate the default feature of the selected packages.

    +
    @@ -247,7 +270,7 @@ be specified multiple times, which enables all specified features.
    --target triple
    -
    Fix for the specified target architecture. Flag may be specified multiple times. The default is the host architecture. The general format of the triple is +

    Fix for the specified target architecture. Flag may be specified multiple times. The default is the host architecture. The general format of the triple is <arch><sub>-<vendor>-<sys>-<abi>.

    Possible values:

    This may also be specified with the build.target config value.

    Note that specifying this flag makes Cargo run in a different mode where the target artifacts are placed in a separate directory. See the -build cache documentation for more details. +build cache documentation for more details.

    +
    -r
    --release
    -
    Fix optimized artifacts with the release profile. -See also the --profile option for choosing a specific profile by name.
    +

    Fix optimized artifacts with the release profile. +See also the --profile option for choosing a specific profile by name.

    +
    --profile name
    -
    Fix with the given profile.

    +

    Fix with the given profile.

    As a special case, specifying the test profile will also enable checking in test mode which will enable checking tests and enable the test cfg option. See rustc tests for more detail.

    -

    See the reference for more details on profiles.

    +

    See the reference for more details on profiles.

    +
    --timings=fmts
    -
    Output information how long each compilation takes, and track concurrency +

    Output information how long each compilation takes, and track concurrency information over time. Accepts an optional comma-separated list of output formats; --timings without an argument will default to --timings=html. Specifying an output format (rather than the default) is unstable and requires @@ -290,7 +316,8 @@ to look at older runs. HTML output is suitable for human consumption only, and does not provide machine-readable timing data.

  • json (unstable, requires -Zunstable-options): Emit machine-readable JSON information about timing information.
  • -
    + + @@ -300,10 +327,11 @@ information about timing information.
    --target-dir directory
    -
    Directory for all generated artifacts and intermediate files. May also be +

    Directory for all generated artifacts and intermediate files. May also be specified with the CARGO_TARGET_DIR environment variable, or the build.target-dir config value. -Defaults to target in the root of the workspace.

    +Defaults to target in the root of the workspace.

    +
    @@ -312,21 +340,23 @@ Defaults to target in the root of the workspace.
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    • auto (default): Automatically detect if color support is available on the terminal.
    • @@ -334,11 +364,12 @@ terminal.
    • never: Never display colors.

    May also be specified with the term.color -config value.

    +config value.

    +
    --message-format fmt
    -
    The output format for diagnostic messages. Can be specified multiple times +

    The output format for diagnostic messages. Can be specified multiple times and consists of comma-separated values. Valid values:

    • human (default): Display in a human-readable text format. Conflicts with @@ -357,7 +388,8 @@ scheme. Cannot be used with human or short.
    • in JSON messages printed, but instead Cargo itself should render the JSON diagnostics coming from rustc. Cargo’s own JSON diagnostics and others coming from rustc are still emitted. Cannot be used with human or short. -
    + +
    @@ -365,16 +397,18 @@ coming from rustc are still emitted. Cannot be used with human or <
    --manifest-path path
    -
    Path to the Cargo.toml file. By default, Cargo searches for the -Cargo.toml file in the current directory or any parent directory.
    +

    Path to the Cargo.toml file. By default, Cargo searches for the +Cargo.toml file in the current directory or any parent directory.

    +
    --ignore-rust-version
    -
    Ignore rust-version specification in packages.
    +

    Ignore rust-version specification in packages.

    +
    --locked
    -
    Asserts that the exact same dependencies and versions are used as when the +

    Asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of the following scenarios arises:

      @@ -382,11 +416,12 @@ error when either of the following scenarios arises:

    • Cargo attempted to change the lock file due to a different dependency resolution.

    It may be used in environments where deterministic builds are desired, -such as in CI pipelines.

    +such as in CI pipelines.

    +
    --offline
    -
    Prevents Cargo from accessing the network for any reason. Without this +

    Prevents Cargo from accessing the network for any reason. Without this flag, Cargo will stop with an error if it needs to access the network and the network is not available. With this flag, Cargo will attempt to proceed without the network if possible.

    @@ -395,15 +430,17 @@ mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. See the cargo-fetch(1) command to download dependencies before going offline.

    -

    May also be specified with the net.offline config value.

    +

    May also be specified with the net.offline config value.

    +
    --frozen
    -
    Equivalent to specifying both --locked and --offline.
    +

    Equivalent to specifying both --locked and --offline.

    +
    --lockfile-path PATH
    -
    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with +

    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with Cargo.lock (e.g. --lockfile-path /tmp/temporary-lockfile/Cargo.lock). Note that providing --lockfile-path will ignore existing lockfile at the default path, and instead will either use the lockfile from PATH, or write a new lockfile into the provided PATH if it doesn’t exist. @@ -411,7 +448,8 @@ This flag can be used to run most commands in read-only directories, writing loc

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#14421).

    +#14421).

    +
    @@ -420,37 +458,42 @@ requires the -Z unstable-options flag to enable (see
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    @@ -460,21 +503,23 @@ requires the -Z unstable-options flag to enable (see
    -j N
    --jobs N
    -
    Number of parallel jobs to run. May also be specified with the +

    Number of parallel jobs to run. May also be specified with the build.jobs config value. Defaults to the number of logical CPUs. If negative, it sets the maximum number of parallel jobs to the number of logical CPUs plus provided value. If a string default is provided, it sets the value back to defaults. -Should not be 0.

    +Should not be 0.

    +
    --keep-going
    -
    Build as many crates in the dependency graph as possible, rather than aborting +

    Build as many crates in the dependency graph as possible, rather than aborting the build on the first one that fails to build.

    For example if the current package depends on dependencies fails and works, one of which fails to build, cargo fix -j1 may or may not build the one that succeeds (depending on which one of the two builds Cargo picked to run first), whereas cargo fix -j1 --keep-going would definitely run both -builds, even if the one run first fails.

    +builds, even if the one run first fails.

    +
    diff --git a/src/doc/src/commands/cargo-generate-lockfile.md b/src/doc/src/commands/cargo-generate-lockfile.md index 4d13a37e07b..9b87b9363a0 100644 --- a/src/doc/src/commands/cargo-generate-lockfile.md +++ b/src/doc/src/commands/cargo-generate-lockfile.md @@ -24,21 +24,23 @@ lockfile and has more options for controlling update behavior.
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    • auto (default): Automatically detect if color support is available on the terminal.
    • @@ -46,7 +48,8 @@ terminal.
    • never: Never display colors.

    May also be specified with the term.color -config value.

    +config value.

    +
    @@ -54,16 +57,18 @@ terminal.
    --manifest-path path
    -
    Path to the Cargo.toml file. By default, Cargo searches for the -Cargo.toml file in the current directory or any parent directory.
    +

    Path to the Cargo.toml file. By default, Cargo searches for the +Cargo.toml file in the current directory or any parent directory.

    +
    --ignore-rust-version
    -
    Ignore rust-version specification in packages.
    +

    Ignore rust-version specification in packages.

    +
    --locked
    -
    Asserts that the exact same dependencies and versions are used as when the +

    Asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of the following scenarios arises:

      @@ -71,11 +76,12 @@ error when either of the following scenarios arises:

    • Cargo attempted to change the lock file due to a different dependency resolution.

    It may be used in environments where deterministic builds are desired, -such as in CI pipelines.

    +such as in CI pipelines.

    +
    --offline
    -
    Prevents Cargo from accessing the network for any reason. Without this +

    Prevents Cargo from accessing the network for any reason. Without this flag, Cargo will stop with an error if it needs to access the network and the network is not available. With this flag, Cargo will attempt to proceed without the network if possible.

    @@ -84,15 +90,17 @@ mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. See the cargo-fetch(1) command to download dependencies before going offline.

    -

    May also be specified with the net.offline config value.

    +

    May also be specified with the net.offline config value.

    +
    --frozen
    -
    Equivalent to specifying both --locked and --offline.
    +

    Equivalent to specifying both --locked and --offline.

    +
    --lockfile-path PATH
    -
    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with +

    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with Cargo.lock (e.g. --lockfile-path /tmp/temporary-lockfile/Cargo.lock). Note that providing --lockfile-path will ignore existing lockfile at the default path, and instead will either use the lockfile from PATH, or write a new lockfile into the provided PATH if it doesn’t exist. @@ -100,7 +108,8 @@ This flag can be used to run most commands in read-only directories, writing loc

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#14421).

    +#14421).

    +
    @@ -109,37 +118,42 @@ requires the -Z unstable-options flag to enable (see
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    diff --git a/src/doc/src/commands/cargo-info.md b/src/doc/src/commands/cargo-info.md index f360f5cf50f..d3489ba3525 100644 --- a/src/doc/src/commands/cargo-info.md +++ b/src/doc/src/commands/cargo-info.md @@ -20,20 +20,23 @@ and presents it in a human-readable format.
    spec
    -
    Fetch information about the specified package. The spec can be a package ID, see cargo-pkgid(1) for the SPEC +

    Fetch information about the specified package. The spec can be a package ID, see cargo-pkgid(1) for the SPEC format. If the specified package is part of the current workspace, information from the local Cargo.toml file will be displayed. If the Cargo.lock file does not exist, it will be created. If no version is specified, the appropriate version will be -selected based on the Minimum Supported Rust Version (MSRV).

    +selected based on the Minimum Supported Rust Version (MSRV).

    +
    --index index
    -
    The URL of the registry index to use.
    +

    The URL of the registry index to use.

    +
    --registry registry
    -
    Name of the registry to use. Registry names are defined in Cargo config +

    Name of the registry to use. Registry names are defined in Cargo config files. If not specified, the default registry is used, which is defined by the registry.default config key which defaults to -crates-io.

    +crates-io.

    +
    @@ -42,21 +45,23 @@ which is defined by the registry.default config key which defaults
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    • auto (default): Automatically detect if color support is available on the terminal.
    • @@ -64,7 +69,8 @@ terminal.
    • never: Never display colors.

    May also be specified with the term.color -config value.

    +config value.

    +
    @@ -72,7 +78,7 @@ terminal.
    --locked
    -
    Asserts that the exact same dependencies and versions are used as when the +

    Asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of the following scenarios arises:

      @@ -80,11 +86,12 @@ error when either of the following scenarios arises:

    • Cargo attempted to change the lock file due to a different dependency resolution.

    It may be used in environments where deterministic builds are desired, -such as in CI pipelines.

    +such as in CI pipelines.

    +
    --offline
    -
    Prevents Cargo from accessing the network for any reason. Without this +

    Prevents Cargo from accessing the network for any reason. Without this flag, Cargo will stop with an error if it needs to access the network and the network is not available. With this flag, Cargo will attempt to proceed without the network if possible.

    @@ -93,11 +100,13 @@ mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. See the cargo-fetch(1) command to download dependencies before going offline.

    -

    May also be specified with the net.offline config value.

    +

    May also be specified with the net.offline config value.

    +
    --frozen
    -
    Equivalent to specifying both --locked and --offline.
    +

    Equivalent to specifying both --locked and --offline.

    +
    @@ -106,37 +115,42 @@ offline.

    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    diff --git a/src/doc/src/commands/cargo-init.md b/src/doc/src/commands/cargo-init.md index e2188564705..66bba7457c5 100644 --- a/src/doc/src/commands/cargo-init.md +++ b/src/doc/src/commands/cargo-init.md @@ -30,38 +30,44 @@ a new directory.
    --bin
    -
    Create a package with a binary target (src/main.rs). -This is the default behavior.
    +

    Create a package with a binary target (src/main.rs). +This is the default behavior.

    +
    --lib
    -
    Create a package with a library target (src/lib.rs).
    +

    Create a package with a library target (src/lib.rs).

    +
    --edition edition
    -
    Specify the Rust edition to use. Default is 2024. -Possible values: 2015, 2018, 2021, 2024
    +

    Specify the Rust edition to use. Default is 2024. +Possible values: 2015, 2018, 2021, 2024

    +
    --name name
    -
    Set the package name. Defaults to the directory name.
    +

    Set the package name. Defaults to the directory name.

    +
    --vcs vcs
    -
    Initialize a new VCS repository for the given version control system (git, +

    Initialize a new VCS repository for the given version control system (git, hg, pijul, or fossil) or do not initialize any version control at all (none). If not specified, defaults to git or the configuration value -cargo-new.vcs, or none if already inside a VCS repository.

    +cargo-new.vcs, or none if already inside a VCS repository.

    +
    --registry registry
    -
    This sets the publish field in Cargo.toml to the given registry name +

    This sets the publish field in Cargo.toml to the given registry name which will restrict publishing only to that registry.

    Registry names are defined in Cargo config files. If not specified, the default registry defined by the registry.default config key is used. If the default registry is not set and --registry is not used, the publish field will not be set which means that publishing will not -be restricted.

    +be restricted.

    +
    @@ -71,21 +77,23 @@ be restricted.
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    • auto (default): Automatically detect if color support is available on the terminal.
    • @@ -93,7 +101,8 @@ terminal.
    • never: Never display colors.

    May also be specified with the term.color -config value.

    +config value.

    +
    @@ -102,37 +111,42 @@ terminal.
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    diff --git a/src/doc/src/commands/cargo-install.md b/src/doc/src/commands/cargo-install.md index c1e9471ca2b..3e731e4c15e 100644 --- a/src/doc/src/commands/cargo-install.md +++ b/src/doc/src/commands/cargo-install.md @@ -92,89 +92,106 @@ will be used, beginning discovery at `$PATH/.cargo/config.toml`.
    --vers version
    --version version
    -
    Specify a version to install. This may be a version +

    Specify a version to install. This may be a version requirement, like ~1.2, to have Cargo select the newest version from the given requirement. If the version does not have a requirement operator (such as ^ or ~), then it must be in the form MAJOR.MINOR.PATCH, and will install exactly that version; it is not -treated as a caret requirement like Cargo dependencies are.

    +treated as a caret requirement like Cargo dependencies are.

    +
    --git url
    -
    Git URL to install the specified crate from.
    +

    Git URL to install the specified crate from.

    +
    --branch branch
    -
    Branch to use when installing from git.
    +

    Branch to use when installing from git.

    +
    --tag tag
    -
    Tag to use when installing from git.
    +

    Tag to use when installing from git.

    +
    --rev sha
    -
    Specific commit to use when installing from git.
    +

    Specific commit to use when installing from git.

    +
    --path path
    -
    Filesystem path to local crate to install from.
    +

    Filesystem path to local crate to install from.

    +
    --list
    -
    List all installed packages and their versions.
    +

    List all installed packages and their versions.

    +
    -n
    --dry-run
    -
    (unstable) Perform all checks without installing.
    +

    (unstable) Perform all checks without installing.

    +
    -f
    --force
    -
    Force overwriting existing crates or binaries. This can be used if a package +

    Force overwriting existing crates or binaries. This can be used if a package has installed a binary with the same name as another package. This is also useful if something has changed on the system that you want to rebuild with, -such as a newer version of rustc.

    +such as a newer version of rustc.

    +
    --no-track
    -
    By default, Cargo keeps track of the installed packages with a metadata file +

    By default, Cargo keeps track of the installed packages with a metadata file stored in the installation root directory. This flag tells Cargo not to use or create that file. With this flag, Cargo will refuse to overwrite any existing files unless the --force flag is used. This also disables Cargo’s ability to protect against multiple concurrent invocations of Cargo installing at the -same time.

    +same time.

    +
    --bin name
    -
    Install only the specified binary.
    +

    Install only the specified binary.

    +
    --bins
    -
    Install all binaries. This is the default behavior.
    +

    Install all binaries. This is the default behavior.

    +
    --example name
    -
    Install only the specified example.
    +

    Install only the specified example.

    +
    --examples
    -
    Install all examples.
    +

    Install all examples.

    +
    --root dir
    -
    Directory to install packages into.
    +

    Directory to install packages into.

    +
    --registry registry
    -
    Name of the registry to use. Registry names are defined in Cargo config +

    Name of the registry to use. Registry names are defined in Cargo config files. If not specified, the default registry is used, which is defined by the registry.default config key which defaults to -crates-io.

    +crates-io.

    +
    --index index
    -
    The URL of the registry index to use.
    +

    The URL of the registry index to use.

    +
    @@ -192,17 +209,20 @@ for more details.
    -F features
    --features features
    -
    Space or comma separated list of features to activate. Features of workspace +

    Space or comma separated list of features to activate. Features of workspace members may be enabled with package-name/feature-name syntax. This flag may -be specified multiple times, which enables all specified features.

    +be specified multiple times, which enables all specified features.

    +
    --all-features
    -
    Activate all available features of all selected packages.
    +

    Activate all available features of all selected packages.

    +
    --no-default-features
    -
    Do not activate the default feature of the selected packages.
    +

    Do not activate the default feature of the selected packages.

    +
    @@ -212,7 +232,7 @@ be specified multiple times, which enables all specified features.
    --target triple
    -
    Install for the specified target architecture. The default is the host architecture. The general format of the triple is +

    Install for the specified target architecture. The default is the host architecture. The general format of the triple is <arch><sub>-<vendor>-<sys>-<abi>.

    Possible values:

    This may also be specified with the build.target config value.

    Note that specifying this flag makes Cargo run in a different mode where the target artifacts are placed in a separate directory. See the -build cache documentation for more details. +build cache documentation for more details.

    +
    --target-dir directory
    -
    Directory for all generated artifacts and intermediate files. May also be +

    Directory for all generated artifacts and intermediate files. May also be specified with the CARGO_TARGET_DIR environment variable, or the build.target-dir config value. Defaults to a new temporary folder located in the temporary directory of the platform.

    When using --path, by default it will use target directory in the workspace of the local crate unless --target-dir -is specified.

    +is specified.

    +
    --debug
    -
    Build with the dev profile instead of the release profile. -See also the --profile option for choosing a specific profile by name.
    +

    Build with the dev profile instead of the release profile. +See also the --profile option for choosing a specific profile by name.

    +
    --profile name
    -
    Install with the given profile. -See the reference for more details on profiles.
    +

    Install with the given profile. +See the reference for more details on profiles.

    +
    --timings=fmts
    -
    Output information how long each compilation takes, and track concurrency +

    Output information how long each compilation takes, and track concurrency information over time. Accepts an optional comma-separated list of output formats; --timings without an argument will default to --timings=html. Specifying an output format (rather than the default) is unstable and requires @@ -261,7 +285,8 @@ to look at older runs. HTML output is suitable for human consumption only, and does not provide machine-readable timing data.

  • json (unstable, requires -Zunstable-options): Emit machine-readable JSON information about timing information.
  • -
    + + @@ -271,11 +296,12 @@ information about timing information.
    --ignore-rust-version
    -
    Ignore rust-version specification in packages.
    +

    Ignore rust-version specification in packages.

    +
    --locked
    -
    Asserts that the exact same dependencies and versions are used as when the +

    Asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of the following scenarios arises:

      @@ -283,11 +309,12 @@ error when either of the following scenarios arises:

    • Cargo attempted to change the lock file due to a different dependency resolution.

    It may be used in environments where deterministic builds are desired, -such as in CI pipelines.

    +such as in CI pipelines.

    +
    --offline
    -
    Prevents Cargo from accessing the network for any reason. Without this +

    Prevents Cargo from accessing the network for any reason. Without this flag, Cargo will stop with an error if it needs to access the network and the network is not available. With this flag, Cargo will attempt to proceed without the network if possible.

    @@ -296,11 +323,13 @@ mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. See the cargo-fetch(1) command to download dependencies before going offline.

    -

    May also be specified with the net.offline config value.

    +

    May also be specified with the net.offline config value.

    +
    --frozen
    -
    Equivalent to specifying both --locked and --offline.
    +

    Equivalent to specifying both --locked and --offline.

    +
    @@ -309,21 +338,23 @@ offline.

    -j N
    --jobs N
    -
    Number of parallel jobs to run. May also be specified with the +

    Number of parallel jobs to run. May also be specified with the build.jobs config value. Defaults to the number of logical CPUs. If negative, it sets the maximum number of parallel jobs to the number of logical CPUs plus provided value. If a string default is provided, it sets the value back to defaults. -Should not be 0.

    +Should not be 0.

    +
    --keep-going
    -
    Build as many crates in the dependency graph as possible, rather than aborting +

    Build as many crates in the dependency graph as possible, rather than aborting the build on the first one that fails to build.

    For example if the current package depends on dependencies fails and works, one of which fails to build, cargo install -j1 may or may not build the one that succeeds (depending on which one of the two builds Cargo picked to run first), whereas cargo install -j1 --keep-going would definitely run both -builds, even if the one run first fails.

    +builds, even if the one run first fails.

    +
    @@ -332,21 +363,23 @@ builds, even if the one run first fails.
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    • auto (default): Automatically detect if color support is available on the terminal.
    • @@ -354,11 +387,12 @@ terminal.
    • never: Never display colors.

    May also be specified with the term.color -config value.

    +config value.

    +
    --message-format fmt
    -
    The output format for diagnostic messages. Can be specified multiple times +

    The output format for diagnostic messages. Can be specified multiple times and consists of comma-separated values. Valid values:

    • human (default): Display in a human-readable text format. Conflicts with @@ -377,7 +411,8 @@ scheme. Cannot be used with human or short.
    • in JSON messages printed, but instead Cargo itself should render the JSON diagnostics coming from rustc. Cargo’s own JSON diagnostics and others coming from rustc are still emitted. Cannot be used with human or short. -
    + +
    @@ -387,37 +422,42 @@ coming from rustc are still emitted. Cannot be used with human or <
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    diff --git a/src/doc/src/commands/cargo-locate-project.md b/src/doc/src/commands/cargo-locate-project.md index 163137307a5..286f0380bc8 100644 --- a/src/doc/src/commands/cargo-locate-project.md +++ b/src/doc/src/commands/cargo-locate-project.md @@ -24,8 +24,9 @@ locating the manifest of a workspace member.
    --workspace
    -
    Locate the Cargo.toml at the root of the workspace, as opposed to the current -workspace member.
    +

    Locate the Cargo.toml at the root of the workspace, as opposed to the current +workspace member.

    +
    @@ -35,30 +36,33 @@ workspace member.
    --message-format fmt
    -
    The representation in which to print the project location. Valid values:

    +

    The representation in which to print the project location. Valid values:

    • json (default): JSON object with the path under the key “root”.
    • plain: Just the path.
    • -
    + +
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    • auto (default): Automatically detect if color support is available on the terminal.
    • @@ -66,7 +70,8 @@ terminal.
    • never: Never display colors.

    May also be specified with the term.color -config value.

    +config value.

    +
    @@ -74,8 +79,9 @@ terminal.
    --manifest-path path
    -
    Path to the Cargo.toml file. By default, Cargo searches for the -Cargo.toml file in the current directory or any parent directory.
    +

    Path to the Cargo.toml file. By default, Cargo searches for the +Cargo.toml file in the current directory or any parent directory.

    +
    @@ -84,37 +90,42 @@ terminal.
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    diff --git a/src/doc/src/commands/cargo-login.md b/src/doc/src/commands/cargo-login.md index 9aabe96d2d3..723912759b6 100644 --- a/src/doc/src/commands/cargo-login.md +++ b/src/doc/src/commands/cargo-login.md @@ -36,10 +36,11 @@ Take care to keep the token secret, it should not be shared with anyone else.
    --registry registry
    -
    Name of the registry to use. Registry names are defined in Cargo config +

    Name of the registry to use. Registry names are defined in Cargo config files. If not specified, the default registry is used, which is defined by the registry.default config key which defaults to -crates-io.

    +crates-io.

    +
    @@ -48,21 +49,23 @@ which is defined by the registry.default config key which defaults
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    • auto (default): Automatically detect if color support is available on the terminal.
    • @@ -70,7 +73,8 @@ terminal.
    • never: Never display colors.

    May also be specified with the term.color -config value.

    +config value.

    +
    @@ -79,37 +83,42 @@ terminal.
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    diff --git a/src/doc/src/commands/cargo-logout.md b/src/doc/src/commands/cargo-logout.md index a7d29ba4e0a..ff150fe9638 100644 --- a/src/doc/src/commands/cargo-logout.md +++ b/src/doc/src/commands/cargo-logout.md @@ -35,10 +35,11 @@ visit the registry website and follow its instructions (see
    --registry registry
    -
    Name of the registry to use. Registry names are defined in Cargo config +

    Name of the registry to use. Registry names are defined in Cargo config files. If not specified, the default registry is used, which is defined by the registry.default config key which defaults to -crates-io.

    +crates-io.

    +
    @@ -47,21 +48,23 @@ which is defined by the registry.default config key which defaults
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    • auto (default): Automatically detect if color support is available on the terminal.
    • @@ -69,7 +72,8 @@ terminal.
    • never: Never display colors.

    May also be specified with the term.color -config value.

    +config value.

    +
    @@ -78,37 +82,42 @@ terminal.
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    diff --git a/src/doc/src/commands/cargo-metadata.md b/src/doc/src/commands/cargo-metadata.md index 420def90703..d18a734c474 100644 --- a/src/doc/src/commands/cargo-metadata.md +++ b/src/doc/src/commands/cargo-metadata.md @@ -350,22 +350,25 @@ Notes:
    --no-deps
    -
    Output information only about the workspace members and don’t fetch -dependencies.
    +

    Output information only about the workspace members and don’t fetch +dependencies.

    +
    --format-version version
    -
    Specify the version of the output format to use. Currently 1 is the only -possible value.
    +

    Specify the version of the output format to use. Currently 1 is the only +possible value.

    +
    --filter-platform triple
    -
    This filters the resolve output to only include dependencies for the +

    This filters the resolve output to only include dependencies for the given target triple. Without this flag, the resolve includes all targets.

    Note that the dependencies listed in the “packages” array still includes all dependencies. Each package definition is intended to be an unaltered -reproduction of the information within Cargo.toml.

    +reproduction of the information within Cargo.toml.

    +
    @@ -383,17 +386,20 @@ for more details.
    -F features
    --features features
    -
    Space or comma separated list of features to activate. Features of workspace +

    Space or comma separated list of features to activate. Features of workspace members may be enabled with package-name/feature-name syntax. This flag may -be specified multiple times, which enables all specified features.

    +be specified multiple times, which enables all specified features.

    +
    --all-features
    -
    Activate all available features of all selected packages.
    +

    Activate all available features of all selected packages.

    +
    --no-default-features
    -
    Do not activate the default feature of the selected packages.
    +

    Do not activate the default feature of the selected packages.

    +
    @@ -403,21 +409,23 @@ be specified multiple times, which enables all specified features.
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    May also be specified with the term.color -config value.

    +config value.

    +
    @@ -433,12 +442,13 @@ terminal.
    --manifest-path path
    -
    Path to the Cargo.toml file. By default, Cargo searches for the -Cargo.toml file in the current directory or any parent directory.
    +

    Path to the Cargo.toml file. By default, Cargo searches for the +Cargo.toml file in the current directory or any parent directory.

    +
    --locked
    -
    Asserts that the exact same dependencies and versions are used as when the +

    Asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of the following scenarios arises:

    It may be used in environments where deterministic builds are desired, -such as in CI pipelines.

    +such as in CI pipelines.

    +
    --offline
    -
    Prevents Cargo from accessing the network for any reason. Without this +

    Prevents Cargo from accessing the network for any reason. Without this flag, Cargo will stop with an error if it needs to access the network and the network is not available. With this flag, Cargo will attempt to proceed without the network if possible.

    @@ -459,15 +470,17 @@ mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. See the cargo-fetch(1) command to download dependencies before going offline.

    -

    May also be specified with the net.offline config value.

    +

    May also be specified with the net.offline config value.

    +
    --frozen
    -
    Equivalent to specifying both --locked and --offline.
    +

    Equivalent to specifying both --locked and --offline.

    +
    --lockfile-path PATH
    -
    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with +

    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with Cargo.lock (e.g. --lockfile-path /tmp/temporary-lockfile/Cargo.lock). Note that providing --lockfile-path will ignore existing lockfile at the default path, and instead will either use the lockfile from PATH, or write a new lockfile into the provided PATH if it doesn’t exist. @@ -475,7 +488,8 @@ This flag can be used to run most commands in read-only directories, writing loc

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#14421).

    +#14421).

    +
    @@ -484,37 +498,42 @@ requires the -Z unstable-options flag to enable (see
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    diff --git a/src/doc/src/commands/cargo-new.md b/src/doc/src/commands/cargo-new.md index 8aed7fdf1f5..c4ef3c0d72a 100644 --- a/src/doc/src/commands/cargo-new.md +++ b/src/doc/src/commands/cargo-new.md @@ -25,38 +25,44 @@ in an existing directory.
    --bin
    -
    Create a package with a binary target (src/main.rs). -This is the default behavior.
    +

    Create a package with a binary target (src/main.rs). +This is the default behavior.

    +
    --lib
    -
    Create a package with a library target (src/lib.rs).
    +

    Create a package with a library target (src/lib.rs).

    +
    --edition edition
    -
    Specify the Rust edition to use. Default is 2024. -Possible values: 2015, 2018, 2021, 2024
    +

    Specify the Rust edition to use. Default is 2024. +Possible values: 2015, 2018, 2021, 2024

    +
    --name name
    -
    Set the package name. Defaults to the directory name.
    +

    Set the package name. Defaults to the directory name.

    +
    --vcs vcs
    -
    Initialize a new VCS repository for the given version control system (git, +

    Initialize a new VCS repository for the given version control system (git, hg, pijul, or fossil) or do not initialize any version control at all (none). If not specified, defaults to git or the configuration value -cargo-new.vcs, or none if already inside a VCS repository.

    +cargo-new.vcs, or none if already inside a VCS repository.

    +
    --registry registry
    -
    This sets the publish field in Cargo.toml to the given registry name +

    This sets the publish field in Cargo.toml to the given registry name which will restrict publishing only to that registry.

    Registry names are defined in Cargo config files. If not specified, the default registry defined by the registry.default config key is used. If the default registry is not set and --registry is not used, the publish field will not be set which means that publishing will not -be restricted.

    +be restricted.

    +
    @@ -66,21 +72,23 @@ be restricted.
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    May also be specified with the term.color -config value.

    +config value.

    +
    @@ -97,37 +106,42 @@ terminal.
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    diff --git a/src/doc/src/commands/cargo-owner.md b/src/doc/src/commands/cargo-owner.md index 7dba77cd9e0..f8c6ff49403 100644 --- a/src/doc/src/commands/cargo-owner.md +++ b/src/doc/src/commands/cargo-owner.md @@ -33,39 +33,45 @@ information about owners and publishing.
    -a
    --add login
    -
    Invite the given user or team as an owner.
    +

    Invite the given user or team as an owner.

    +
    -r
    --remove login
    -
    Remove the given user or team as an owner.
    +

    Remove the given user or team as an owner.

    +
    -l
    --list
    -
    List owners of a crate.
    +

    List owners of a crate.

    +
    --token token
    -
    API token to use when authenticating. This overrides the token stored in +

    API token to use when authenticating. This overrides the token stored in the credentials file (which is created by cargo-login(1)).

    Cargo config environment variables can be used to override the tokens stored in the credentials file. The token for crates.io may be specified with the CARGO_REGISTRY_TOKEN environment variable. Tokens for other registries may be specified with environment variables of the form CARGO_REGISTRIES_NAME_TOKEN where NAME is the name -of the registry in all capital letters.

    +of the registry in all capital letters.

    +
    --index index
    -
    The URL of the registry index to use.
    +

    The URL of the registry index to use.

    +
    --registry registry
    -
    Name of the registry to use. Registry names are defined in Cargo config +

    Name of the registry to use. Registry names are defined in Cargo config files. If not specified, the default registry is used, which is defined by the registry.default config key which defaults to -crates-io.

    +crates-io.

    + @@ -75,21 +81,23 @@ which is defined by the registry.default config key which defaults
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    May also be specified with the term.color -config value.

    +config value.

    +
    @@ -106,37 +115,42 @@ terminal.
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    diff --git a/src/doc/src/commands/cargo-package.md b/src/doc/src/commands/cargo-package.md index 75cbf295cbd..cf9ae1213a7 100644 --- a/src/doc/src/commands/cargo-package.md +++ b/src/doc/src/commands/cargo-package.md @@ -78,43 +78,50 @@ There is no guarantee that the source code in the tarball matches the VCS inform
    -l
    --list
    -
    Print files included in a package without making one.
    +

    Print files included in a package without making one.

    +
    --no-verify
    -
    Don’t verify the contents by building them.
    +

    Don’t verify the contents by building them.

    +
    --no-metadata
    -
    Ignore warnings about a lack of human-usable metadata (such as the description -or the license).
    +

    Ignore warnings about a lack of human-usable metadata (such as the description +or the license).

    +
    --allow-dirty
    -
    Allow working directories with uncommitted VCS changes to be packaged.
    +

    Allow working directories with uncommitted VCS changes to be packaged.

    +
    --exclude-lockfile
    -
    Don’t include the lock file when packaging.

    +

    Don’t include the lock file when packaging.

    This flag is not for general use. Some tools may expect a lock file to be present (e.g. cargo install --locked). -Consider other options before using this.

    +Consider other options before using this.

    +
    --index index
    -
    The URL of the registry index to use.
    +

    The URL of the registry index to use.

    +
    --registry registry
    -
    Name of the registry to package for; see cargo publish --help for more details +

    Name of the registry to package for; see cargo publish --help for more details about configuration of registry names. The packages will not be published to this registry, but if we are packaging multiple inter-dependent crates, lock-files will be generated under the assumption that dependencies will be -published to this registry.

    +published to this registry.

    +
    --message-format fmt
    -
    Specifies the output message format. +

    Specifies the output message format. Currently, it only works with --list and affects the file listing format. This is unstable and requires -Zunstable-options. Valid output formats:

    @@ -153,7 +160,8 @@ One package per JSON line (Newline delimited JSON). } -
    + + @@ -175,24 +183,27 @@ virtual workspace will include all workspace members (equivalent to passing
    -p spec
    --package spec
    -
    Package only the specified packages. See cargo-pkgid(1) for the +

    Package only the specified packages. See cargo-pkgid(1) for the SPEC format. This flag may be specified multiple times and supports common Unix glob patterns like *, ? and []. However, to avoid your shell accidentally expanding glob patterns before Cargo handles them, you must use single quotes or -double quotes around each pattern.

    +double quotes around each pattern.

    +
    --workspace
    -
    Package all members in the workspace.
    +

    Package all members in the workspace.

    +
    --exclude SPEC
    -
    Exclude the specified packages. Must be used in conjunction with the +

    Exclude the specified packages. Must be used in conjunction with the --workspace flag. This flag may be specified multiple times and supports common Unix glob patterns like *, ? and []. However, to avoid your shell accidentally expanding glob patterns before Cargo handles them, you must use -single quotes or double quotes around each pattern.

    +single quotes or double quotes around each pattern.

    + @@ -202,7 +213,7 @@ single quotes or double quotes around each pattern.
    --target triple
    -
    Package for the specified target architecture. Flag may be specified multiple times. The default is the host architecture. The general format of the triple is +

    Package for the specified target architecture. Flag may be specified multiple times. The default is the host architecture. The general format of the triple is <arch><sub>-<vendor>-<sys>-<abi>.

    Possible values:

    This may also be specified with the build.target config value.

    Note that specifying this flag makes Cargo run in a different mode where the target artifacts are placed in a separate directory. See the -build cache documentation for more details. +build cache documentation for more details.

    +
    --target-dir directory
    -
    Directory for all generated artifacts and intermediate files. May also be +

    Directory for all generated artifacts and intermediate files. May also be specified with the CARGO_TARGET_DIR environment variable, or the build.target-dir config value. -Defaults to target in the root of the workspace.

    +Defaults to target in the root of the workspace.

    +
    @@ -238,17 +251,20 @@ for more details.
    -F features
    --features features
    -
    Space or comma separated list of features to activate. Features of workspace +

    Space or comma separated list of features to activate. Features of workspace members may be enabled with package-name/feature-name syntax. This flag may -be specified multiple times, which enables all specified features.

    +be specified multiple times, which enables all specified features.

    +
    --all-features
    -
    Activate all available features of all selected packages.
    +

    Activate all available features of all selected packages.

    +
    --no-default-features
    -
    Do not activate the default feature of the selected packages.
    +

    Do not activate the default feature of the selected packages.

    +
    @@ -258,12 +274,13 @@ be specified multiple times, which enables all specified features.
    --manifest-path path
    -
    Path to the Cargo.toml file. By default, Cargo searches for the -Cargo.toml file in the current directory or any parent directory.
    +

    Path to the Cargo.toml file. By default, Cargo searches for the +Cargo.toml file in the current directory or any parent directory.

    +
    --locked
    -
    Asserts that the exact same dependencies and versions are used as when the +

    Asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of the following scenarios arises:

    It may be used in environments where deterministic builds are desired, -such as in CI pipelines.

    +such as in CI pipelines.

    +
    --offline
    -
    Prevents Cargo from accessing the network for any reason. Without this +

    Prevents Cargo from accessing the network for any reason. Without this flag, Cargo will stop with an error if it needs to access the network and the network is not available. With this flag, Cargo will attempt to proceed without the network if possible.

    @@ -284,15 +302,17 @@ mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. See the cargo-fetch(1) command to download dependencies before going offline.

    -

    May also be specified with the net.offline config value.

    +

    May also be specified with the net.offline config value.

    +
    --frozen
    -
    Equivalent to specifying both --locked and --offline.
    +

    Equivalent to specifying both --locked and --offline.

    +
    --lockfile-path PATH
    -
    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with +

    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with Cargo.lock (e.g. --lockfile-path /tmp/temporary-lockfile/Cargo.lock). Note that providing --lockfile-path will ignore existing lockfile at the default path, and instead will either use the lockfile from PATH, or write a new lockfile into the provided PATH if it doesn’t exist. @@ -300,7 +320,8 @@ This flag can be used to run most commands in read-only directories, writing loc

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#14421).

    +#14421).

    +
    @@ -310,21 +331,23 @@ requires the -Z unstable-options flag to enable (see
    -j N
    --jobs N
    -
    Number of parallel jobs to run. May also be specified with the +

    Number of parallel jobs to run. May also be specified with the build.jobs config value. Defaults to the number of logical CPUs. If negative, it sets the maximum number of parallel jobs to the number of logical CPUs plus provided value. If a string default is provided, it sets the value back to defaults. -Should not be 0.

    +Should not be 0.

    +
    --keep-going
    -
    Build as many crates in the dependency graph as possible, rather than aborting +

    Build as many crates in the dependency graph as possible, rather than aborting the build on the first one that fails to build.

    For example if the current package depends on dependencies fails and works, one of which fails to build, cargo package -j1 may or may not build the one that succeeds (depending on which one of the two builds Cargo picked to run first), whereas cargo package -j1 --keep-going would definitely run both -builds, even if the one run first fails.

    +builds, even if the one run first fails.

    +
    @@ -333,21 +356,23 @@ builds, even if the one run first fails.
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    May also be specified with the term.color -config value.

    +config value.

    +
    @@ -364,37 +390,42 @@ terminal.
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    diff --git a/src/doc/src/commands/cargo-pkgid.md b/src/doc/src/commands/cargo-pkgid.md index 43c3bd54775..1ad97bd92e6 100644 --- a/src/doc/src/commands/cargo-pkgid.md +++ b/src/doc/src/commands/cargo-pkgid.md @@ -45,7 +45,8 @@ The specification grammar can be found in chapter [Package ID Specifications].
    -p spec
    --package spec
    -
    Get the package ID for the given package instead of the current package.
    +

    Get the package ID for the given package instead of the current package.

    +
    @@ -55,21 +56,23 @@ The specification grammar can be found in chapter [Package ID Specifications].
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    May also be specified with the term.color -config value.

    +config value.

    +
    @@ -86,12 +90,13 @@ terminal.
    --manifest-path path
    -
    Path to the Cargo.toml file. By default, Cargo searches for the -Cargo.toml file in the current directory or any parent directory.
    +

    Path to the Cargo.toml file. By default, Cargo searches for the +Cargo.toml file in the current directory or any parent directory.

    +
    --locked
    -
    Asserts that the exact same dependencies and versions are used as when the +

    Asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of the following scenarios arises:

    It may be used in environments where deterministic builds are desired, -such as in CI pipelines.

    +such as in CI pipelines.

    +
    --offline
    -
    Prevents Cargo from accessing the network for any reason. Without this +

    Prevents Cargo from accessing the network for any reason. Without this flag, Cargo will stop with an error if it needs to access the network and the network is not available. With this flag, Cargo will attempt to proceed without the network if possible.

    @@ -112,15 +118,17 @@ mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. See the cargo-fetch(1) command to download dependencies before going offline.

    -

    May also be specified with the net.offline config value.

    +

    May also be specified with the net.offline config value.

    +
    --frozen
    -
    Equivalent to specifying both --locked and --offline.
    +

    Equivalent to specifying both --locked and --offline.

    +
    --lockfile-path PATH
    -
    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with +

    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with Cargo.lock (e.g. --lockfile-path /tmp/temporary-lockfile/Cargo.lock). Note that providing --lockfile-path will ignore existing lockfile at the default path, and instead will either use the lockfile from PATH, or write a new lockfile into the provided PATH if it doesn’t exist. @@ -128,7 +136,8 @@ This flag can be used to run most commands in read-only directories, writing loc

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#14421).

    +#14421).

    +
    @@ -138,37 +147,42 @@ requires the -Z unstable-options flag to enable (see
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    diff --git a/src/doc/src/commands/cargo-publish.md b/src/doc/src/commands/cargo-publish.md index b8bb1a99303..4bc2f608cd1 100644 --- a/src/doc/src/commands/cargo-publish.md +++ b/src/doc/src/commands/cargo-publish.md @@ -38,29 +38,34 @@ packaging and publishing.
    --dry-run
    -
    Perform all checks without uploading.
    +

    Perform all checks without uploading.

    +
    --no-verify
    -
    Don’t verify the contents by building them.
    +

    Don’t verify the contents by building them.

    +
    --allow-dirty
    -
    Allow working directories with uncommitted VCS changes to be packaged.
    +

    Allow working directories with uncommitted VCS changes to be packaged.

    +
    --index index
    -
    The URL of the registry index to use.
    +

    The URL of the registry index to use.

    +
    --registry registry
    -
    Name of the registry to publish to. Registry names are defined in Cargo +

    Name of the registry to publish to. Registry names are defined in Cargo config files. If not specified, and there is a package.publish field in Cargo.toml with a single registry, then it will publish to that registry. Otherwise it will use the default registry, which is defined by the registry.default config key -which defaults to crates-io.

    +which defaults to crates-io.

    +
    @@ -82,27 +87,31 @@ virtual workspace will include all workspace members (equivalent to passing
    -p spec
    --package spec
    -
    Publish only the specified packages. See cargo-pkgid(1) for the +

    Publish only the specified packages. See cargo-pkgid(1) for the SPEC format. This flag may be specified multiple times and supports common Unix glob patterns like *, ? and []. However, to avoid your shell accidentally expanding glob patterns before Cargo handles them, you must use single quotes or -double quotes around each pattern.

    +double quotes around each pattern.

    +
    --workspace
    -
    Publish all members in the workspace.
    +

    Publish all members in the workspace.

    +
    --all
    -
    Deprecated alias for --workspace.
    +

    Deprecated alias for --workspace.

    +
    --exclude SPEC
    -
    Exclude the specified packages. Must be used in conjunction with the +

    Exclude the specified packages. Must be used in conjunction with the --workspace flag. This flag may be specified multiple times and supports common Unix glob patterns like *, ? and []. However, to avoid your shell accidentally expanding glob patterns before Cargo handles them, you must use -single quotes or double quotes around each pattern.

    +single quotes or double quotes around each pattern.

    + @@ -112,7 +121,7 @@ single quotes or double quotes around each pattern.
    --target triple
    -
    Publish for the specified target architecture. Flag may be specified multiple times. The default is the host architecture. The general format of the triple is +

    Publish for the specified target architecture. Flag may be specified multiple times. The default is the host architecture. The general format of the triple is <arch><sub>-<vendor>-<sys>-<abi>.

    Possible values:

    This may also be specified with the build.target config value.

    Note that specifying this flag makes Cargo run in a different mode where the target artifacts are placed in a separate directory. See the -build cache documentation for more details. +build cache documentation for more details.

    +
    --target-dir directory
    -
    Directory for all generated artifacts and intermediate files. May also be +

    Directory for all generated artifacts and intermediate files. May also be specified with the CARGO_TARGET_DIR environment variable, or the build.target-dir config value. -Defaults to target in the root of the workspace.

    +Defaults to target in the root of the workspace.

    +
    @@ -148,17 +159,20 @@ for more details.
    -F features
    --features features
    -
    Space or comma separated list of features to activate. Features of workspace +

    Space or comma separated list of features to activate. Features of workspace members may be enabled with package-name/feature-name syntax. This flag may -be specified multiple times, which enables all specified features.

    +be specified multiple times, which enables all specified features.

    +
    --all-features
    -
    Activate all available features of all selected packages.
    +

    Activate all available features of all selected packages.

    +
    --no-default-features
    -
    Do not activate the default feature of the selected packages.
    +

    Do not activate the default feature of the selected packages.

    +
    @@ -168,12 +182,13 @@ be specified multiple times, which enables all specified features.
    --manifest-path path
    -
    Path to the Cargo.toml file. By default, Cargo searches for the -Cargo.toml file in the current directory or any parent directory.
    +

    Path to the Cargo.toml file. By default, Cargo searches for the +Cargo.toml file in the current directory or any parent directory.

    +
    --locked
    -
    Asserts that the exact same dependencies and versions are used as when the +

    Asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of the following scenarios arises:

    It may be used in environments where deterministic builds are desired, -such as in CI pipelines.

    +such as in CI pipelines.

    +
    --offline
    -
    Prevents Cargo from accessing the network for any reason. Without this +

    Prevents Cargo from accessing the network for any reason. Without this flag, Cargo will stop with an error if it needs to access the network and the network is not available. With this flag, Cargo will attempt to proceed without the network if possible.

    @@ -194,15 +210,17 @@ mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. See the cargo-fetch(1) command to download dependencies before going offline.

    -

    May also be specified with the net.offline config value.

    +

    May also be specified with the net.offline config value.

    +
    --frozen
    -
    Equivalent to specifying both --locked and --offline.
    +

    Equivalent to specifying both --locked and --offline.

    +
    --lockfile-path PATH
    -
    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with +

    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with Cargo.lock (e.g. --lockfile-path /tmp/temporary-lockfile/Cargo.lock). Note that providing --lockfile-path will ignore existing lockfile at the default path, and instead will either use the lockfile from PATH, or write a new lockfile into the provided PATH if it doesn’t exist. @@ -210,7 +228,8 @@ This flag can be used to run most commands in read-only directories, writing loc

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#14421).

    +#14421).

    +
    @@ -220,21 +239,23 @@ requires the -Z unstable-options flag to enable (see
    -j N
    --jobs N
    -
    Number of parallel jobs to run. May also be specified with the +

    Number of parallel jobs to run. May also be specified with the build.jobs config value. Defaults to the number of logical CPUs. If negative, it sets the maximum number of parallel jobs to the number of logical CPUs plus provided value. If a string default is provided, it sets the value back to defaults. -Should not be 0.

    +Should not be 0.

    +
    --keep-going
    -
    Build as many crates in the dependency graph as possible, rather than aborting +

    Build as many crates in the dependency graph as possible, rather than aborting the build on the first one that fails to build.

    For example if the current package depends on dependencies fails and works, one of which fails to build, cargo publish -j1 may or may not build the one that succeeds (depending on which one of the two builds Cargo picked to run first), whereas cargo publish -j1 --keep-going would definitely run both -builds, even if the one run first fails.

    +builds, even if the one run first fails.

    +
    @@ -243,21 +264,23 @@ builds, even if the one run first fails.
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    May also be specified with the term.color -config value.

    +config value.

    +
    @@ -274,37 +298,42 @@ terminal.
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    diff --git a/src/doc/src/commands/cargo-remove.md b/src/doc/src/commands/cargo-remove.md index 9cae4839828..32f46c9bf1c 100644 --- a/src/doc/src/commands/cargo-remove.md +++ b/src/doc/src/commands/cargo-remove.md @@ -18,16 +18,19 @@ Remove one or more dependencies from a `Cargo.toml` manifest.
    --dev
    -
    Remove as a development dependency.
    +

    Remove as a development dependency.

    +
    --build
    -
    Remove as a build dependency.
    +

    Remove as a build dependency.

    +
    --target target
    -
    Remove as a dependency to the given target platform.

    -

    To avoid unexpected shell expansions, you may use quotes around each target, e.g., --target 'cfg(unix)'.

    +

    Remove as a dependency to the given target platform.

    +

    To avoid unexpected shell expansions, you may use quotes around each target, e.g., --target 'cfg(unix)'.

    +
    @@ -37,7 +40,8 @@ Remove one or more dependencies from a `Cargo.toml` manifest.
    --dry-run
    -
    Don’t actually write to the manifest.
    +

    Don’t actually write to the manifest.

    +
    @@ -47,21 +51,23 @@ Remove one or more dependencies from a `Cargo.toml` manifest.
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    May also be specified with the term.color -config value.

    +config value.

    +
    @@ -77,12 +84,13 @@ terminal.
    --manifest-path path
    -
    Path to the Cargo.toml file. By default, Cargo searches for the -Cargo.toml file in the current directory or any parent directory.
    +

    Path to the Cargo.toml file. By default, Cargo searches for the +Cargo.toml file in the current directory or any parent directory.

    +
    --locked
    -
    Asserts that the exact same dependencies and versions are used as when the +

    Asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of the following scenarios arises:

    It may be used in environments where deterministic builds are desired, -such as in CI pipelines.

    +such as in CI pipelines.

    +
    --offline
    -
    Prevents Cargo from accessing the network for any reason. Without this +

    Prevents Cargo from accessing the network for any reason. Without this flag, Cargo will stop with an error if it needs to access the network and the network is not available. With this flag, Cargo will attempt to proceed without the network if possible.

    @@ -103,15 +112,17 @@ mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. See the cargo-fetch(1) command to download dependencies before going offline.

    -

    May also be specified with the net.offline config value.

    +

    May also be specified with the net.offline config value.

    +
    --frozen
    -
    Equivalent to specifying both --locked and --offline.
    +

    Equivalent to specifying both --locked and --offline.

    +
    --lockfile-path PATH
    -
    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with +

    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with Cargo.lock (e.g. --lockfile-path /tmp/temporary-lockfile/Cargo.lock). Note that providing --lockfile-path will ignore existing lockfile at the default path, and instead will either use the lockfile from PATH, or write a new lockfile into the provided PATH if it doesn’t exist. @@ -119,7 +130,8 @@ This flag can be used to run most commands in read-only directories, writing loc

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#14421).

    +#14421).

    +
    @@ -129,7 +141,8 @@ requires the -Z unstable-options flag to enable (see
    -p spec
    --package spec
    -
    Package to remove from.
    +

    Package to remove from.

    +
    @@ -139,37 +152,42 @@ requires the -Z unstable-options flag to enable (see
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    diff --git a/src/doc/src/commands/cargo-report.md b/src/doc/src/commands/cargo-report.md index 130449d1200..c05cfbbff94 100644 --- a/src/doc/src/commands/cargo-report.md +++ b/src/doc/src/commands/cargo-report.md @@ -17,12 +17,14 @@ Displays a report of the given _type_ --- currently, only `future-incompat` is s
    --id id
    -
    Show the report with the specified Cargo-generated id
    +

    Show the report with the specified Cargo-generated id

    +
    -p spec
    --package spec
    -
    Only display a report for the specified package
    +

    Only display a report for the specified package

    +
    diff --git a/src/doc/src/commands/cargo-run.md b/src/doc/src/commands/cargo-run.md index 3fae83c054f..31722c951e6 100644 --- a/src/doc/src/commands/cargo-run.md +++ b/src/doc/src/commands/cargo-run.md @@ -30,8 +30,9 @@ flag can be used to choose a different package in a workspace.
    -p spec
    --package spec
    -
    The package to run. See cargo-pkgid(1) for the SPEC -format.
    +

    The package to run. See cargo-pkgid(1) for the SPEC +format.

    +
    @@ -46,11 +47,13 @@ section of `Cargo.toml` to choose the name of the binary to run by default.
    --bin name
    -
    Run the specified binary.
    +

    Run the specified binary.

    +
    --example name
    -
    Run the specified example.
    +

    Run the specified example.

    +
    @@ -68,17 +71,20 @@ for more details.
    -F features
    --features features
    -
    Space or comma separated list of features to activate. Features of workspace +

    Space or comma separated list of features to activate. Features of workspace members may be enabled with package-name/feature-name syntax. This flag may -be specified multiple times, which enables all specified features.

    +be specified multiple times, which enables all specified features.

    +
    --all-features
    -
    Activate all available features of all selected packages.
    +

    Activate all available features of all selected packages.

    +
    --no-default-features
    -
    Do not activate the default feature of the selected packages.
    +

    Do not activate the default feature of the selected packages.

    +
    @@ -88,7 +94,7 @@ be specified multiple times, which enables all specified features.
    --target triple
    -
    Run for the specified target architecture. The default is the host architecture. The general format of the triple is +

    Run for the specified target architecture. The default is the host architecture. The general format of the triple is <arch><sub>-<vendor>-<sys>-<abi>.

    Possible values:

    This may also be specified with the build.target config value.

    Note that specifying this flag makes Cargo run in a different mode where the target artifacts are placed in a separate directory. See the -build cache documentation for more details. +build cache documentation for more details.

    +
    -r
    --release
    -
    Run optimized artifacts with the release profile. -See also the --profile option for choosing a specific profile by name.
    +

    Run optimized artifacts with the release profile. +See also the --profile option for choosing a specific profile by name.

    +
    --profile name
    -
    Run with the given profile. -See the reference for more details on profiles.
    +

    Run with the given profile. +See the reference for more details on profiles.

    +
    --timings=fmts
    -
    Output information how long each compilation takes, and track concurrency +

    Output information how long each compilation takes, and track concurrency information over time. Accepts an optional comma-separated list of output formats; --timings without an argument will default to --timings=html. Specifying an output format (rather than the default) is unstable and requires @@ -127,7 +136,8 @@ to look at older runs. HTML output is suitable for human consumption only, and does not provide machine-readable timing data.

  • json (unstable, requires -Zunstable-options): Emit machine-readable JSON information about timing information.
  • -
    + + @@ -137,10 +147,11 @@ information about timing information.
    --target-dir directory
    -
    Directory for all generated artifacts and intermediate files. May also be +

    Directory for all generated artifacts and intermediate files. May also be specified with the CARGO_TARGET_DIR environment variable, or the build.target-dir config value. -Defaults to target in the root of the workspace.

    +Defaults to target in the root of the workspace.

    +
    @@ -150,21 +161,23 @@ Defaults to target in the root of the workspace.
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    May also be specified with the term.color -config value.

    +config value.

    +
    --message-format fmt
    -
    The output format for diagnostic messages. Can be specified multiple times +

    The output format for diagnostic messages. Can be specified multiple times and consists of comma-separated values. Valid values:

    + +
    @@ -205,16 +220,18 @@ coming from rustc are still emitted. Cannot be used with human or <
    --manifest-path path
    -
    Path to the Cargo.toml file. By default, Cargo searches for the -Cargo.toml file in the current directory or any parent directory.
    +

    Path to the Cargo.toml file. By default, Cargo searches for the +Cargo.toml file in the current directory or any parent directory.

    +
    --ignore-rust-version
    -
    Ignore rust-version specification in packages.
    +

    Ignore rust-version specification in packages.

    +
    --locked
    -
    Asserts that the exact same dependencies and versions are used as when the +

    Asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of the following scenarios arises:

    It may be used in environments where deterministic builds are desired, -such as in CI pipelines.

    +such as in CI pipelines.

    +
    --offline
    -
    Prevents Cargo from accessing the network for any reason. Without this +

    Prevents Cargo from accessing the network for any reason. Without this flag, Cargo will stop with an error if it needs to access the network and the network is not available. With this flag, Cargo will attempt to proceed without the network if possible.

    @@ -235,15 +253,17 @@ mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. See the cargo-fetch(1) command to download dependencies before going offline.

    -

    May also be specified with the net.offline config value.

    +

    May also be specified with the net.offline config value.

    +
    --frozen
    -
    Equivalent to specifying both --locked and --offline.
    +

    Equivalent to specifying both --locked and --offline.

    +
    --lockfile-path PATH
    -
    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with +

    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with Cargo.lock (e.g. --lockfile-path /tmp/temporary-lockfile/Cargo.lock). Note that providing --lockfile-path will ignore existing lockfile at the default path, and instead will either use the lockfile from PATH, or write a new lockfile into the provided PATH if it doesn’t exist. @@ -251,7 +271,8 @@ This flag can be used to run most commands in read-only directories, writing loc

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#14421).

    +#14421).

    +
    @@ -261,37 +282,42 @@ requires the -Z unstable-options flag to enable (see
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    @@ -301,21 +327,23 @@ requires the -Z unstable-options flag to enable (see
    -j N
    --jobs N
    -
    Number of parallel jobs to run. May also be specified with the +

    Number of parallel jobs to run. May also be specified with the build.jobs config value. Defaults to the number of logical CPUs. If negative, it sets the maximum number of parallel jobs to the number of logical CPUs plus provided value. If a string default is provided, it sets the value back to defaults. -Should not be 0.

    +Should not be 0.

    +
    --keep-going
    -
    Build as many crates in the dependency graph as possible, rather than aborting +

    Build as many crates in the dependency graph as possible, rather than aborting the build on the first one that fails to build.

    For example if the current package depends on dependencies fails and works, one of which fails to build, cargo run -j1 may or may not build the one that succeeds (depending on which one of the two builds Cargo picked to run first), whereas cargo run -j1 --keep-going would definitely run both -builds, even if the one run first fails.

    +builds, even if the one run first fails.

    +
    diff --git a/src/doc/src/commands/cargo-rustc.md b/src/doc/src/commands/cargo-rustc.md index 979c5731ee4..af33eb38ee4 100644 --- a/src/doc/src/commands/cargo-rustc.md +++ b/src/doc/src/commands/cargo-rustc.md @@ -39,8 +39,9 @@ flag can be used to choose a different package in a workspace.
    -p spec
    --package spec
    -
    The package to build. See cargo-pkgid(1) for the SPEC -format.
    +

    The package to build. See cargo-pkgid(1) for the SPEC +format.

    +
    @@ -70,59 +71,69 @@ use single quotes or double quotes around each glob pattern.
    --lib
    -
    Build the package’s library.
    +

    Build the package’s library.

    +
    --bin name
    -
    Build the specified binary. This flag may be specified multiple times -and supports common Unix glob patterns.
    +

    Build the specified binary. This flag may be specified multiple times +and supports common Unix glob patterns.

    +
    --bins
    -
    Build all binary targets.
    +

    Build all binary targets.

    +
    --example name
    -
    Build the specified example. This flag may be specified multiple times -and supports common Unix glob patterns.
    +

    Build the specified example. This flag may be specified multiple times +and supports common Unix glob patterns.

    +
    --examples
    -
    Build all example targets.
    +

    Build all example targets.

    +
    --test name
    -
    Build the specified integration test. This flag may be specified -multiple times and supports common Unix glob patterns.
    +

    Build the specified integration test. This flag may be specified +multiple times and supports common Unix glob patterns.

    +
    --tests
    -
    Build all targets that have the test = true manifest +

    Build all targets that have the test = true manifest flag set. By default this includes the library and binaries built as unittests, and integration tests. Be aware that this will also build any required dependencies, so the lib target may be built twice (once as a unittest, and once as a dependency for binaries, integration tests, etc.). Targets may be enabled or disabled by setting the test flag in the -manifest settings for the target.

    +manifest settings for the target.

    +
    --bench name
    -
    Build the specified benchmark. This flag may be specified multiple -times and supports common Unix glob patterns.
    +

    Build the specified benchmark. This flag may be specified multiple +times and supports common Unix glob patterns.

    +
    --benches
    -
    Build all targets that have the bench = true +

    Build all targets that have the bench = true manifest flag set. By default this includes the library and binaries built as benchmarks, and bench targets. Be aware that this will also build any required dependencies, so the lib target may be built twice (once as a benchmark, and once as a dependency for binaries, benchmarks, etc.). Targets may be enabled or disabled by setting the bench flag in the -manifest settings for the target.

    +manifest settings for the target.

    +
    --all-targets
    -
    Build all targets. This is equivalent to specifying --lib --bins --tests --benches --examples.
    +

    Build all targets. This is equivalent to specifying --lib --bins --tests --benches --examples.

    +
    @@ -140,17 +151,20 @@ for more details.
    -F features
    --features features
    -
    Space or comma separated list of features to activate. Features of workspace +

    Space or comma separated list of features to activate. Features of workspace members may be enabled with package-name/feature-name syntax. This flag may -be specified multiple times, which enables all specified features.

    +be specified multiple times, which enables all specified features.

    +
    --all-features
    -
    Activate all available features of all selected packages.
    +

    Activate all available features of all selected packages.

    +
    --no-default-features
    -
    Do not activate the default feature of the selected packages.
    +

    Do not activate the default feature of the selected packages.

    +
    @@ -160,7 +174,7 @@ be specified multiple times, which enables all specified features.
    --target triple
    -
    Build for the specified target architecture. Flag may be specified multiple times. The default is the host architecture. The general format of the triple is +

    Build for the specified target architecture. Flag may be specified multiple times. The default is the host architecture. The general format of the triple is <arch><sub>-<vendor>-<sys>-<abi>.

    Possible values:

    This may also be specified with the build.target config value.

    Note that specifying this flag makes Cargo run in a different mode where the target artifacts are placed in a separate directory. See the -build cache documentation for more details. +build cache documentation for more details.

    +
    -r
    --release
    -
    Build optimized artifacts with the release profile. -See also the --profile option for choosing a specific profile by name.
    +

    Build optimized artifacts with the release profile. +See also the --profile option for choosing a specific profile by name.

    +
    --profile name
    -
    Build with the given profile.

    +

    Build with the given profile.

    The rustc subcommand will treat the following named profiles with special behaviors:

    -

    See the reference for more details on profiles.

    +

    See the reference for more details on profiles.

    +
    --timings=fmts
    -
    Output information how long each compilation takes, and track concurrency +

    Output information how long each compilation takes, and track concurrency information over time. Accepts an optional comma-separated list of output formats; --timings without an argument will default to --timings=html. Specifying an output format (rather than the default) is unstable and requires @@ -210,19 +227,21 @@ to look at older runs. HTML output is suitable for human consumption only, and does not provide machine-readable timing data.

  • json (unstable, requires -Zunstable-options): Emit machine-readable JSON information about timing information.
  • -
    + +
    --crate-type crate-type
    -
    Build for the given crate type. This flag accepts a comma-separated list of +

    Build for the given crate type. This flag accepts a comma-separated list of 1 or more crate types, of which the allowed values are the same as crate-type field in the manifest for configuring a Cargo target. See crate-type field for possible values.

    If the manifest contains a list, and --crate-type is provided, the command-line argument value will override what is in the manifest.

    -

    This flag only works when building a lib or example library target.

    +

    This flag only works when building a lib or example library target.

    +
    @@ -231,10 +250,11 @@ the command-line argument value will override what is in the manifest.

    --target-dir directory
    -
    Directory for all generated artifacts and intermediate files. May also be +

    Directory for all generated artifacts and intermediate files. May also be specified with the CARGO_TARGET_DIR environment variable, or the build.target-dir config value. -Defaults to target in the root of the workspace.

    +Defaults to target in the root of the workspace.

    +
    @@ -244,21 +264,23 @@ Defaults to target in the root of the workspace.
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    May also be specified with the term.color -config value.

    +config value.

    +
    --message-format fmt
    -
    The output format for diagnostic messages. Can be specified multiple times +

    The output format for diagnostic messages. Can be specified multiple times and consists of comma-separated values. Valid values:

    + + @@ -299,16 +323,18 @@ coming from rustc are still emitted. Cannot be used with human or <
    --manifest-path path
    -
    Path to the Cargo.toml file. By default, Cargo searches for the -Cargo.toml file in the current directory or any parent directory.
    +

    Path to the Cargo.toml file. By default, Cargo searches for the +Cargo.toml file in the current directory or any parent directory.

    +
    --ignore-rust-version
    -
    Ignore rust-version specification in packages.
    +

    Ignore rust-version specification in packages.

    +
    --locked
    -
    Asserts that the exact same dependencies and versions are used as when the +

    Asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of the following scenarios arises:

    It may be used in environments where deterministic builds are desired, -such as in CI pipelines.

    +such as in CI pipelines.

    +
    --offline
    -
    Prevents Cargo from accessing the network for any reason. Without this +

    Prevents Cargo from accessing the network for any reason. Without this flag, Cargo will stop with an error if it needs to access the network and the network is not available. With this flag, Cargo will attempt to proceed without the network if possible.

    @@ -329,15 +356,17 @@ mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. See the cargo-fetch(1) command to download dependencies before going offline.

    -

    May also be specified with the net.offline config value.

    +

    May also be specified with the net.offline config value.

    +
    --frozen
    -
    Equivalent to specifying both --locked and --offline.
    +

    Equivalent to specifying both --locked and --offline.

    +
    --lockfile-path PATH
    -
    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with +

    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with Cargo.lock (e.g. --lockfile-path /tmp/temporary-lockfile/Cargo.lock). Note that providing --lockfile-path will ignore existing lockfile at the default path, and instead will either use the lockfile from PATH, or write a new lockfile into the provided PATH if it doesn’t exist. @@ -345,7 +374,8 @@ This flag can be used to run most commands in read-only directories, writing loc

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#14421).

    +#14421).

    +
    @@ -355,37 +385,42 @@ requires the -Z unstable-options flag to enable (see
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    @@ -395,26 +430,29 @@ requires the -Z unstable-options flag to enable (see
    -j N
    --jobs N
    -
    Number of parallel jobs to run. May also be specified with the +

    Number of parallel jobs to run. May also be specified with the build.jobs config value. Defaults to the number of logical CPUs. If negative, it sets the maximum number of parallel jobs to the number of logical CPUs plus provided value. If a string default is provided, it sets the value back to defaults. -Should not be 0.

    +Should not be 0.

    +
    --keep-going
    -
    Build as many crates in the dependency graph as possible, rather than aborting +

    Build as many crates in the dependency graph as possible, rather than aborting the build on the first one that fails to build.

    For example if the current package depends on dependencies fails and works, one of which fails to build, cargo rustc -j1 may or may not build the one that succeeds (depending on which one of the two builds Cargo picked to run first), whereas cargo rustc -j1 --keep-going would definitely run both -builds, even if the one run first fails.

    +builds, even if the one run first fails.

    +
    --future-incompat-report
    -
    Displays a future-incompat report for any future-incompatible warnings +

    Displays a future-incompat report for any future-incompatible warnings produced during execution of this command

    -

    See cargo-report(1)

    +

    See cargo-report(1)

    +
    diff --git a/src/doc/src/commands/cargo-rustdoc.md b/src/doc/src/commands/cargo-rustdoc.md index 4e0efe186a7..ebb8b7b6358 100644 --- a/src/doc/src/commands/cargo-rustdoc.md +++ b/src/doc/src/commands/cargo-rustdoc.md @@ -35,10 +35,11 @@ or the `build.rustdocflags` [config value](../reference/config.html).
    --open
    -
    Open the docs in a browser after building them. This will use your default +

    Open the docs in a browser after building them. This will use your default browser unless you define another one in the BROWSER environment variable or use the doc.browser configuration -option.

    +option.

    +
    @@ -52,8 +53,9 @@ flag can be used to choose a different package in a workspace.
    -p spec
    --package spec
    -
    The package to document. See cargo-pkgid(1) for the SPEC -format.
    +

    The package to document. See cargo-pkgid(1) for the SPEC +format.

    +
    @@ -76,59 +78,69 @@ use single quotes or double quotes around each glob pattern.
    --lib
    -
    Document the package’s library.
    +

    Document the package’s library.

    +
    --bin name
    -
    Document the specified binary. This flag may be specified multiple times -and supports common Unix glob patterns.
    +

    Document the specified binary. This flag may be specified multiple times +and supports common Unix glob patterns.

    +
    --bins
    -
    Document all binary targets.
    +

    Document all binary targets.

    +
    --example name
    -
    Document the specified example. This flag may be specified multiple times -and supports common Unix glob patterns.
    +

    Document the specified example. This flag may be specified multiple times +and supports common Unix glob patterns.

    +
    --examples
    -
    Document all example targets.
    +

    Document all example targets.

    +
    --test name
    -
    Document the specified integration test. This flag may be specified -multiple times and supports common Unix glob patterns.
    +

    Document the specified integration test. This flag may be specified +multiple times and supports common Unix glob patterns.

    +
    --tests
    -
    Document all targets that have the test = true manifest +

    Document all targets that have the test = true manifest flag set. By default this includes the library and binaries built as unittests, and integration tests. Be aware that this will also build any required dependencies, so the lib target may be built twice (once as a unittest, and once as a dependency for binaries, integration tests, etc.). Targets may be enabled or disabled by setting the test flag in the -manifest settings for the target.

    +manifest settings for the target.

    +
    --bench name
    -
    Document the specified benchmark. This flag may be specified multiple -times and supports common Unix glob patterns.
    +

    Document the specified benchmark. This flag may be specified multiple +times and supports common Unix glob patterns.

    +
    --benches
    -
    Document all targets that have the bench = true +

    Document all targets that have the bench = true manifest flag set. By default this includes the library and binaries built as benchmarks, and bench targets. Be aware that this will also build any required dependencies, so the lib target may be built twice (once as a benchmark, and once as a dependency for binaries, benchmarks, etc.). Targets may be enabled or disabled by setting the bench flag in the -manifest settings for the target.

    +manifest settings for the target.

    +
    --all-targets
    -
    Document all targets. This is equivalent to specifying --lib --bins --tests --benches --examples.
    +

    Document all targets. This is equivalent to specifying --lib --bins --tests --benches --examples.

    +
    @@ -146,17 +158,20 @@ for more details.
    -F features
    --features features
    -
    Space or comma separated list of features to activate. Features of workspace +

    Space or comma separated list of features to activate. Features of workspace members may be enabled with package-name/feature-name syntax. This flag may -be specified multiple times, which enables all specified features.

    +be specified multiple times, which enables all specified features.

    +
    --all-features
    -
    Activate all available features of all selected packages.
    +

    Activate all available features of all selected packages.

    +
    --no-default-features
    -
    Do not activate the default feature of the selected packages.
    +

    Do not activate the default feature of the selected packages.

    +
    @@ -166,7 +181,7 @@ be specified multiple times, which enables all specified features.
    --target triple
    -
    Document for the specified target architecture. Flag may be specified multiple times. The default is the host architecture. The general format of the triple is +

    Document for the specified target architecture. Flag may be specified multiple times. The default is the host architecture. The general format of the triple is <arch><sub>-<vendor>-<sys>-<abi>.

    Possible values:

    This may also be specified with the build.target config value.

    Note that specifying this flag makes Cargo run in a different mode where the target artifacts are placed in a separate directory. See the -build cache documentation for more details. +build cache documentation for more details.

    +
    -r
    --release
    -
    Document optimized artifacts with the release profile. -See also the --profile option for choosing a specific profile by name.
    +

    Document optimized artifacts with the release profile. +See also the --profile option for choosing a specific profile by name.

    +
    --profile name
    -
    Document with the given profile. -See the reference for more details on profiles.
    +

    Document with the given profile. +See the reference for more details on profiles.

    +
    --timings=fmts
    -
    Output information how long each compilation takes, and track concurrency +

    Output information how long each compilation takes, and track concurrency information over time. Accepts an optional comma-separated list of output formats; --timings without an argument will default to --timings=html. Specifying an output format (rather than the default) is unstable and requires @@ -205,7 +223,8 @@ to look at older runs. HTML output is suitable for human consumption only, and does not provide machine-readable timing data.

  • json (unstable, requires -Zunstable-options): Emit machine-readable JSON information about timing information.
  • -
    + + @@ -215,10 +234,11 @@ information about timing information.
    --target-dir directory
    -
    Directory for all generated artifacts and intermediate files. May also be +

    Directory for all generated artifacts and intermediate files. May also be specified with the CARGO_TARGET_DIR environment variable, or the build.target-dir config value. -Defaults to target in the root of the workspace.

    +Defaults to target in the root of the workspace.

    +
    @@ -227,21 +247,23 @@ Defaults to target in the root of the workspace.
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    • auto (default): Automatically detect if color support is available on the terminal.
    • @@ -249,11 +271,12 @@ terminal.
    • never: Never display colors.

    May also be specified with the term.color -config value.

    +config value.

    +
    --message-format fmt
    -
    The output format for diagnostic messages. Can be specified multiple times +

    The output format for diagnostic messages. Can be specified multiple times and consists of comma-separated values. Valid values:

    • human (default): Display in a human-readable text format. Conflicts with @@ -272,7 +295,8 @@ scheme. Cannot be used with human or short.
    • in JSON messages printed, but instead Cargo itself should render the JSON diagnostics coming from rustc. Cargo’s own JSON diagnostics and others coming from rustc are still emitted. Cannot be used with human or short. -
    + +
    @@ -280,16 +304,18 @@ coming from rustc are still emitted. Cannot be used with human or <
    --manifest-path path
    -
    Path to the Cargo.toml file. By default, Cargo searches for the -Cargo.toml file in the current directory or any parent directory.
    +

    Path to the Cargo.toml file. By default, Cargo searches for the +Cargo.toml file in the current directory or any parent directory.

    +
    --ignore-rust-version
    -
    Ignore rust-version specification in packages.
    +

    Ignore rust-version specification in packages.

    +
    --locked
    -
    Asserts that the exact same dependencies and versions are used as when the +

    Asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of the following scenarios arises:

      @@ -297,11 +323,12 @@ error when either of the following scenarios arises:

    • Cargo attempted to change the lock file due to a different dependency resolution.

    It may be used in environments where deterministic builds are desired, -such as in CI pipelines.

    +such as in CI pipelines.

    +
    --offline
    -
    Prevents Cargo from accessing the network for any reason. Without this +

    Prevents Cargo from accessing the network for any reason. Without this flag, Cargo will stop with an error if it needs to access the network and the network is not available. With this flag, Cargo will attempt to proceed without the network if possible.

    @@ -310,15 +337,17 @@ mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. See the cargo-fetch(1) command to download dependencies before going offline.

    -

    May also be specified with the net.offline config value.

    +

    May also be specified with the net.offline config value.

    +
    --frozen
    -
    Equivalent to specifying both --locked and --offline.
    +

    Equivalent to specifying both --locked and --offline.

    +
    --lockfile-path PATH
    -
    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with +

    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with Cargo.lock (e.g. --lockfile-path /tmp/temporary-lockfile/Cargo.lock). Note that providing --lockfile-path will ignore existing lockfile at the default path, and instead will either use the lockfile from PATH, or write a new lockfile into the provided PATH if it doesn’t exist. @@ -326,7 +355,8 @@ This flag can be used to run most commands in read-only directories, writing loc

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#14421).

    +#14421).

    +
    @@ -335,37 +365,42 @@ requires the -Z unstable-options flag to enable (see
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    @@ -375,30 +410,33 @@ requires the -Z unstable-options flag to enable (see
    -j N
    --jobs N
    -
    Number of parallel jobs to run. May also be specified with the +

    Number of parallel jobs to run. May also be specified with the build.jobs config value. Defaults to the number of logical CPUs. If negative, it sets the maximum number of parallel jobs to the number of logical CPUs plus provided value. If a string default is provided, it sets the value back to defaults. -Should not be 0.

    +Should not be 0.

    +
    --keep-going
    -
    Build as many crates in the dependency graph as possible, rather than aborting +

    Build as many crates in the dependency graph as possible, rather than aborting the build on the first one that fails to build.

    For example if the current package depends on dependencies fails and works, one of which fails to build, cargo rustdoc -j1 may or may not build the one that succeeds (depending on which one of the two builds Cargo picked to run first), whereas cargo rustdoc -j1 --keep-going would definitely run both -builds, even if the one run first fails.

    +builds, even if the one run first fails.

    +
    --output-format
    -
    The output type for the documentation emitted. Valid values:

    +

    The output type for the documentation emitted. Valid values:

    This option is only available on the nightly channel -and requires the -Z unstable-options flag to enable.

    +and requires the -Z unstable-options flag to enable.

    +
    diff --git a/src/doc/src/commands/cargo-search.md b/src/doc/src/commands/cargo-search.md index 9bfdfeadb10..d04a8a7248c 100644 --- a/src/doc/src/commands/cargo-search.md +++ b/src/doc/src/commands/cargo-search.md @@ -21,18 +21,21 @@ for copying into a `Cargo.toml` manifest.
    --limit limit
    -
    Limit the number of results (default: 10, max: 100).
    +

    Limit the number of results (default: 10, max: 100).

    +
    --index index
    -
    The URL of the registry index to use.
    +

    The URL of the registry index to use.

    +
    --registry registry
    -
    Name of the registry to use. Registry names are defined in Cargo config +

    Name of the registry to use. Registry names are defined in Cargo config files. If not specified, the default registry is used, which is defined by the registry.default config key which defaults to -crates-io.

    +crates-io.

    +
    @@ -42,21 +45,23 @@ which is defined by the registry.default config key which defaults
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    • auto (default): Automatically detect if color support is available on the terminal.
    • @@ -64,7 +69,8 @@ terminal.
    • never: Never display colors.

    May also be specified with the term.color -config value.

    +config value.

    +
    @@ -73,37 +79,42 @@ terminal.
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    diff --git a/src/doc/src/commands/cargo-test.md b/src/doc/src/commands/cargo-test.md index 1b6a31aa111..b4c086bd06a 100644 --- a/src/doc/src/commands/cargo-test.md +++ b/src/doc/src/commands/cargo-test.md @@ -75,14 +75,16 @@ directory of the package the test belongs to, and is controlled via `rustdoc`'s
    --no-run
    -
    Compile, but don’t run tests.
    +

    Compile, but don’t run tests.

    +
    --no-fail-fast
    -
    Run all tests regardless of failure. Without this flag, Cargo will exit +

    Run all tests regardless of failure. Without this flag, Cargo will exit after the first executable fails. The Rust test harness will run all tests within the executable to completion, this flag only applies to the executable -as a whole.

    +as a whole.

    +
    @@ -104,27 +106,31 @@ virtual workspace will include all workspace members (equivalent to passing
    -p spec
    --package spec
    -
    Test only the specified packages. See cargo-pkgid(1) for the +

    Test only the specified packages. See cargo-pkgid(1) for the SPEC format. This flag may be specified multiple times and supports common Unix glob patterns like *, ? and []. However, to avoid your shell accidentally expanding glob patterns before Cargo handles them, you must use single quotes or -double quotes around each pattern.

    +double quotes around each pattern.

    +
    --workspace
    -
    Test all members in the workspace.
    +

    Test all members in the workspace.

    +
    --all
    -
    Deprecated alias for --workspace.
    +

    Deprecated alias for --workspace.

    +
    --exclude SPEC
    -
    Exclude the specified packages. Must be used in conjunction with the +

    Exclude the specified packages. Must be used in conjunction with the --workspace flag. This flag may be specified multiple times and supports common Unix glob patterns like *, ? and []. However, to avoid your shell accidentally expanding glob patterns before Cargo handles them, you must use -single quotes or double quotes around each pattern.

    +single quotes or double quotes around each pattern.

    +
    @@ -179,59 +185,69 @@ use single quotes or double quotes around each glob pattern.
    --lib
    -
    Test the package’s library.
    +

    Test the package’s library.

    +
    --bin name
    -
    Test the specified binary. This flag may be specified multiple times -and supports common Unix glob patterns.
    +

    Test the specified binary. This flag may be specified multiple times +and supports common Unix glob patterns.

    +
    --bins
    -
    Test all binary targets.
    +

    Test all binary targets.

    +
    --example name
    -
    Test the specified example. This flag may be specified multiple times -and supports common Unix glob patterns.
    +

    Test the specified example. This flag may be specified multiple times +and supports common Unix glob patterns.

    +
    --examples
    -
    Test all example targets.
    +

    Test all example targets.

    +
    --test name
    -
    Test the specified integration test. This flag may be specified -multiple times and supports common Unix glob patterns.
    +

    Test the specified integration test. This flag may be specified +multiple times and supports common Unix glob patterns.

    +
    --tests
    -
    Test all targets that have the test = true manifest +

    Test all targets that have the test = true manifest flag set. By default this includes the library and binaries built as unittests, and integration tests. Be aware that this will also build any required dependencies, so the lib target may be built twice (once as a unittest, and once as a dependency for binaries, integration tests, etc.). Targets may be enabled or disabled by setting the test flag in the -manifest settings for the target.

    +manifest settings for the target.

    +
    --bench name
    -
    Test the specified benchmark. This flag may be specified multiple -times and supports common Unix glob patterns.
    +

    Test the specified benchmark. This flag may be specified multiple +times and supports common Unix glob patterns.

    +
    --benches
    -
    Test all targets that have the bench = true +

    Test all targets that have the bench = true manifest flag set. By default this includes the library and binaries built as benchmarks, and bench targets. Be aware that this will also build any required dependencies, so the lib target may be built twice (once as a benchmark, and once as a dependency for binaries, benchmarks, etc.). Targets may be enabled or disabled by setting the bench flag in the -manifest settings for the target.

    +manifest settings for the target.

    +
    --all-targets
    -
    Test all targets. This is equivalent to specifying --lib --bins --tests --benches --examples.
    +

    Test all targets. This is equivalent to specifying --lib --bins --tests --benches --examples.

    +
    @@ -239,8 +255,9 @@ manifest settings for the target.
    --doc
    -
    Test only the library’s documentation. This cannot be mixed with other -target options.
    +

    Test only the library’s documentation. This cannot be mixed with other +target options.

    +
    @@ -258,17 +275,20 @@ for more details.
    -F features
    --features features
    -
    Space or comma separated list of features to activate. Features of workspace +

    Space or comma separated list of features to activate. Features of workspace members may be enabled with package-name/feature-name syntax. This flag may -be specified multiple times, which enables all specified features.

    +be specified multiple times, which enables all specified features.

    +
    --all-features
    -
    Activate all available features of all selected packages.
    +

    Activate all available features of all selected packages.

    +
    --no-default-features
    -
    Do not activate the default feature of the selected packages.
    +

    Do not activate the default feature of the selected packages.

    +
    @@ -278,7 +298,7 @@ be specified multiple times, which enables all specified features.
    --target triple
    -
    Test for the specified target architecture. Flag may be specified multiple times. The default is the host architecture. The general format of the triple is +

    Test for the specified target architecture. Flag may be specified multiple times. The default is the host architecture. The general format of the triple is <arch><sub>-<vendor>-<sys>-<abi>.

    Possible values:

    This may also be specified with the build.target config value.

    Note that specifying this flag makes Cargo run in a different mode where the target artifacts are placed in a separate directory. See the -build cache documentation for more details. +build cache documentation for more details.

    +
    -r
    --release
    -
    Test optimized artifacts with the release profile. -See also the --profile option for choosing a specific profile by name.
    +

    Test optimized artifacts with the release profile. +See also the --profile option for choosing a specific profile by name.

    +
    --profile name
    -
    Test with the given profile. -See the reference for more details on profiles.
    +

    Test with the given profile. +See the reference for more details on profiles.

    +
    --timings=fmts
    -
    Output information how long each compilation takes, and track concurrency +

    Output information how long each compilation takes, and track concurrency information over time. Accepts an optional comma-separated list of output formats; --timings without an argument will default to --timings=html. Specifying an output format (rather than the default) is unstable and requires @@ -317,7 +340,8 @@ to look at older runs. HTML output is suitable for human consumption only, and does not provide machine-readable timing data.

  • json (unstable, requires -Zunstable-options): Emit machine-readable JSON information about timing information.
  • -
    + + @@ -327,10 +351,11 @@ information about timing information.
    --target-dir directory
    -
    Directory for all generated artifacts and intermediate files. May also be +

    Directory for all generated artifacts and intermediate files. May also be specified with the CARGO_TARGET_DIR environment variable, or the build.target-dir config value. -Defaults to target in the root of the workspace.

    +Defaults to target in the root of the workspace.

    +
    @@ -346,21 +371,23 @@ results readable. Test output can be recovered (e.g., for debugging) by passing
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    May also be specified with the term.color -config value.

    +config value.

    +
    --message-format fmt
    -
    The output format for diagnostic messages. Can be specified multiple times +

    The output format for diagnostic messages. Can be specified multiple times and consists of comma-separated values. Valid values:

    + +
    @@ -401,16 +430,18 @@ coming from rustc are still emitted. Cannot be used with human or <
    --manifest-path path
    -
    Path to the Cargo.toml file. By default, Cargo searches for the -Cargo.toml file in the current directory or any parent directory.
    +

    Path to the Cargo.toml file. By default, Cargo searches for the +Cargo.toml file in the current directory or any parent directory.

    +
    --ignore-rust-version
    -
    Ignore rust-version specification in packages.
    +

    Ignore rust-version specification in packages.

    +
    --locked
    -
    Asserts that the exact same dependencies and versions are used as when the +

    Asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of the following scenarios arises:

    It may be used in environments where deterministic builds are desired, -such as in CI pipelines.

    +such as in CI pipelines.

    +
    --offline
    -
    Prevents Cargo from accessing the network for any reason. Without this +

    Prevents Cargo from accessing the network for any reason. Without this flag, Cargo will stop with an error if it needs to access the network and the network is not available. With this flag, Cargo will attempt to proceed without the network if possible.

    @@ -431,15 +463,17 @@ mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. See the cargo-fetch(1) command to download dependencies before going offline.

    -

    May also be specified with the net.offline config value.

    +

    May also be specified with the net.offline config value.

    +
    --frozen
    -
    Equivalent to specifying both --locked and --offline.
    +

    Equivalent to specifying both --locked and --offline.

    +
    --lockfile-path PATH
    -
    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with +

    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with Cargo.lock (e.g. --lockfile-path /tmp/temporary-lockfile/Cargo.lock). Note that providing --lockfile-path will ignore existing lockfile at the default path, and instead will either use the lockfile from PATH, or write a new lockfile into the provided PATH if it doesn’t exist. @@ -447,7 +481,8 @@ This flag can be used to run most commands in read-only directories, writing loc

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#14421).

    +#14421).

    +
    @@ -457,37 +492,42 @@ requires the -Z unstable-options flag to enable (see
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    @@ -504,17 +544,19 @@ includes an option to control the number of threads used:
    -j N
    --jobs N
    -
    Number of parallel jobs to run. May also be specified with the +

    Number of parallel jobs to run. May also be specified with the build.jobs config value. Defaults to the number of logical CPUs. If negative, it sets the maximum number of parallel jobs to the number of logical CPUs plus provided value. If a string default is provided, it sets the value back to defaults. -Should not be 0.

    +Should not be 0.

    +
    --future-incompat-report
    -
    Displays a future-incompat report for any future-incompatible warnings +

    Displays a future-incompat report for any future-incompatible warnings produced during execution of this command

    -

    See cargo-report(1)

    +

    See cargo-report(1)

    + diff --git a/src/doc/src/commands/cargo-tree.md b/src/doc/src/commands/cargo-tree.md index 9418eaa9d1c..412afd8715e 100644 --- a/src/doc/src/commands/cargo-tree.md +++ b/src/doc/src/commands/cargo-tree.md @@ -75,49 +75,54 @@ To learn more about feature unification, check out this
    -i spec
    --invert spec
    -
    Show the reverse dependencies for the given package. This flag will invert +

    Show the reverse dependencies for the given package. This flag will invert the tree and display the packages that depend on the given package.

    Note that in a workspace, by default it will only display the package’s reverse dependencies inside the tree of the workspace member in the current directory. The --workspace flag can be used to extend it so that it will show the package’s reverse dependencies across the entire workspace. The -p flag can be used to display the package’s reverse dependencies only with the -subtree of the package given to -p.

    +subtree of the package given to -p.

    +
    --prune spec
    -
    Prune the given package from the display of the dependency tree.
    +

    Prune the given package from the display of the dependency tree.

    +
    --depth depth
    -
    Maximum display depth of the dependency tree. A depth of 1 displays the direct +

    Maximum display depth of the dependency tree. A depth of 1 displays the direct dependencies, for example.

    If the given value is workspace, only shows the dependencies that are member -of the current workspace, instead.

    +of the current workspace, instead.

    +
    --no-dedupe
    -
    Do not de-duplicate repeated dependencies. Usually, when a package has already +

    Do not de-duplicate repeated dependencies. Usually, when a package has already displayed its dependencies, further occurrences will not re-display its dependencies, and will include a (*) to indicate it has already been shown. -This flag will cause those duplicates to be repeated.

    +This flag will cause those duplicates to be repeated.

    +
    -d
    --duplicates
    -
    Show only dependencies which come in multiple versions (implies --invert). +

    Show only dependencies which come in multiple versions (implies --invert). When used with the -p flag, only shows duplicates within the subtree of the given package.

    It can be beneficial for build times and executable sizes to avoid building that same package multiple times. This flag can help identify the offending packages. You can then investigate if the package that depends on the duplicate with the older version can be updated to the newer version so that -only one instance is built.

    +only one instance is built.

    +
    -e kinds
    --edges kinds
    -
    The dependency kinds to display. Takes a comma separated list of values:

    +

    The dependency kinds to display. Takes a comma separated list of values:

    The normal, build, dev, and all dependency kinds cannot be mixed with no-normal, no-build, or no-dev dependency kinds.

    -

    The default is normal,build,dev.

    +

    The default is normal,build,dev.

    +
    --target triple
    -
    Filter dependencies matching the given target triple. -The default is the host platform. Use the value all to include all targets.
    +

    Filter dependencies matching the given target triple. +The default is the host platform. Use the value all to include all targets.

    +
    @@ -147,13 +154,14 @@ The default is the host platform. Use the value all to include
    --charset charset
    -
    Chooses the character set to use for the tree. Valid values are “utf8” or -“ascii”. When unspecified, cargo will auto-select a value.
    +

    Chooses the character set to use for the tree. Valid values are “utf8” or +“ascii”. When unspecified, cargo will auto-select a value.

    +
    -f format
    --format format
    -
    Set the format string for each package. The default is “{p}”.

    +

    Set the format string for each package. The default is “{p}”.

    This is an arbitrary string which will be used to display each package. The following strings will be replaced with the corresponding value:

      @@ -162,16 +170,18 @@ strings will be replaced with the corresponding value:

    • {r} — The package repository URL.
    • {f} — Comma-separated list of package features that are enabled.
    • {lib} — The name, as used in a use statement, of the package’s library.
    • -
    + +
    --prefix prefix
    -
    Sets how each line is displayed. The prefix value can be one of:

    +

    Sets how each line is displayed. The prefix value can be one of:

    • indent (default) — Shows each line indented as a tree.
    • depth — Show as a list, with the numeric depth printed before each entry.
    • none — Show as a flat list.
    • -
    + +
    @@ -193,24 +203,27 @@ virtual workspace will include all workspace members (equivalent to passing
    -p spec
    --package spec
    -
    Display only the specified packages. See cargo-pkgid(1) for the +

    Display only the specified packages. See cargo-pkgid(1) for the SPEC format. This flag may be specified multiple times and supports common Unix glob patterns like *, ? and []. However, to avoid your shell accidentally expanding glob patterns before Cargo handles them, you must use single quotes or -double quotes around each pattern.

    +double quotes around each pattern.

    +
    --workspace
    -
    Display all members in the workspace.
    +

    Display all members in the workspace.

    +
    --exclude SPEC
    -
    Exclude the specified packages. Must be used in conjunction with the +

    Exclude the specified packages. Must be used in conjunction with the --workspace flag. This flag may be specified multiple times and supports common Unix glob patterns like *, ? and []. However, to avoid your shell accidentally expanding glob patterns before Cargo handles them, you must use -single quotes or double quotes around each pattern.

    +single quotes or double quotes around each pattern.

    + @@ -220,12 +233,13 @@ single quotes or double quotes around each pattern.
    --manifest-path path
    -
    Path to the Cargo.toml file. By default, Cargo searches for the -Cargo.toml file in the current directory or any parent directory.
    +

    Path to the Cargo.toml file. By default, Cargo searches for the +Cargo.toml file in the current directory or any parent directory.

    +
    --locked
    -
    Asserts that the exact same dependencies and versions are used as when the +

    Asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of the following scenarios arises:

      @@ -233,11 +247,12 @@ error when either of the following scenarios arises:

    • Cargo attempted to change the lock file due to a different dependency resolution.

    It may be used in environments where deterministic builds are desired, -such as in CI pipelines.

    +such as in CI pipelines.

    +
    --offline
    -
    Prevents Cargo from accessing the network for any reason. Without this +

    Prevents Cargo from accessing the network for any reason. Without this flag, Cargo will stop with an error if it needs to access the network and the network is not available. With this flag, Cargo will attempt to proceed without the network if possible.

    @@ -246,15 +261,17 @@ mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. See the cargo-fetch(1) command to download dependencies before going offline.

    -

    May also be specified with the net.offline config value.

    +

    May also be specified with the net.offline config value.

    +
    --frozen
    -
    Equivalent to specifying both --locked and --offline.
    +

    Equivalent to specifying both --locked and --offline.

    +
    --lockfile-path PATH
    -
    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with +

    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with Cargo.lock (e.g. --lockfile-path /tmp/temporary-lockfile/Cargo.lock). Note that providing --lockfile-path will ignore existing lockfile at the default path, and instead will either use the lockfile from PATH, or write a new lockfile into the provided PATH if it doesn’t exist. @@ -262,7 +279,8 @@ This flag can be used to run most commands in read-only directories, writing loc

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#14421).

    +#14421).

    +
    @@ -279,17 +297,20 @@ for more details.
    -F features
    --features features
    -
    Space or comma separated list of features to activate. Features of workspace +

    Space or comma separated list of features to activate. Features of workspace members may be enabled with package-name/feature-name syntax. This flag may -be specified multiple times, which enables all specified features.

    +be specified multiple times, which enables all specified features.

    +
    --all-features
    -
    Activate all available features of all selected packages.
    +

    Activate all available features of all selected packages.

    +
    --no-default-features
    -
    Do not activate the default feature of the selected packages.
    +

    Do not activate the default feature of the selected packages.

    +
    @@ -300,21 +321,23 @@ be specified multiple times, which enables all specified features.
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    May also be specified with the term.color -config value.

    +config value.

    + @@ -332,37 +356,42 @@ terminal.
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    diff --git a/src/doc/src/commands/cargo-uninstall.md b/src/doc/src/commands/cargo-uninstall.md index 1a573eccf88..080e793c4bb 100644 --- a/src/doc/src/commands/cargo-uninstall.md +++ b/src/doc/src/commands/cargo-uninstall.md @@ -33,15 +33,18 @@ The installation root is determined, in order of precedence:
    -p
    --package spec
    -
    Package to uninstall.
    +

    Package to uninstall.

    +
    --bin name
    -
    Only uninstall the binary name.
    +

    Only uninstall the binary name.

    +
    --root dir
    -
    Directory to uninstall packages from.
    +

    Directory to uninstall packages from.

    +
    @@ -52,21 +55,23 @@ The installation root is determined, in order of precedence:
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    May also be specified with the term.color -config value.

    +config value.

    + @@ -84,37 +90,42 @@ terminal.
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    diff --git a/src/doc/src/commands/cargo-update.md b/src/doc/src/commands/cargo-update.md index 1d1521a35a4..ed0571a5c45 100644 --- a/src/doc/src/commands/cargo-update.md +++ b/src/doc/src/commands/cargo-update.md @@ -21,34 +21,37 @@ latest available versions.
    spec
    -
    Update only the specified packages. This flag may be specified +

    Update only the specified packages. This flag may be specified multiple times. See cargo-pkgid(1) for the SPEC format.

    If packages are specified with spec, then a conservative update of the lockfile will be performed. This means that only the dependency specified by SPEC will be updated. Its transitive dependencies will be updated only if SPEC cannot be updated without updating dependencies. All other dependencies will remain locked at their currently recorded versions.

    -

    If spec is not specified, all dependencies are updated.

    +

    If spec is not specified, all dependencies are updated.

    +
    --recursive
    -
    When used with spec, dependencies of spec are forced to update as well. -Cannot be used with --precise.
    +

    When used with spec, dependencies of spec are forced to update as well. +Cannot be used with --precise.

    +
    --precise precise
    -
    When used with spec, allows you to specify a specific version number to set +

    When used with spec, allows you to specify a specific version number to set the package to. If the package comes from a git repository, this can be a git revision (such as a SHA hash or tag).

    While not recommended, you can specify a yanked version of a package. When possible, try other non-yanked SemVer-compatible versions or seek help from the maintainers of the package.

    A compatible pre-release version can also be specified even when the version -requirement in Cargo.toml doesn’t contain any pre-release identifier (nightly only).

    +requirement in Cargo.toml doesn’t contain any pre-release identifier (nightly only).

    +
    --breaking directory
    -
    Update spec to latest SemVer-breaking version.

    +

    Update spec to latest SemVer-breaking version.

    Version requirements will be modified to allow this update.

    This only applies to dependencies when

    +See https://github.com/rust-lang/cargo/issues/12425 for more information.

    +
    -w
    --workspace
    -
    Attempt to update only packages defined in the workspace. Other packages +

    Attempt to update only packages defined in the workspace. Other packages are updated only if they don’t already exist in the lockfile. This option is useful for updating Cargo.lock after you’ve changed version -numbers in Cargo.toml.

    +numbers in Cargo.toml.

    +
    --dry-run
    -
    Displays what would be updated, but doesn’t actually write the lockfile.
    +

    Displays what would be updated, but doesn’t actually write the lockfile.

    +
    @@ -82,21 +88,23 @@ numbers in Cargo.toml.
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    • auto (default): Automatically detect if color support is available on the terminal.
    • @@ -104,7 +112,8 @@ terminal.
    • never: Never display colors.

    May also be specified with the term.color -config value.

    +config value.

    +
    @@ -113,16 +122,18 @@ terminal.
    --manifest-path path
    -
    Path to the Cargo.toml file. By default, Cargo searches for the -Cargo.toml file in the current directory or any parent directory.
    +

    Path to the Cargo.toml file. By default, Cargo searches for the +Cargo.toml file in the current directory or any parent directory.

    +
    --ignore-rust-version
    -
    Ignore rust-version specification in packages.
    +

    Ignore rust-version specification in packages.

    +
    --locked
    -
    Asserts that the exact same dependencies and versions are used as when the +

    Asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of the following scenarios arises:

      @@ -130,11 +141,12 @@ error when either of the following scenarios arises:

    • Cargo attempted to change the lock file due to a different dependency resolution.

    It may be used in environments where deterministic builds are desired, -such as in CI pipelines.

    +such as in CI pipelines.

    +
    --offline
    -
    Prevents Cargo from accessing the network for any reason. Without this +

    Prevents Cargo from accessing the network for any reason. Without this flag, Cargo will stop with an error if it needs to access the network and the network is not available. With this flag, Cargo will attempt to proceed without the network if possible.

    @@ -143,15 +155,17 @@ mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. See the cargo-fetch(1) command to download dependencies before going offline.

    -

    May also be specified with the net.offline config value.

    +

    May also be specified with the net.offline config value.

    +
    --frozen
    -
    Equivalent to specifying both --locked and --offline.
    +

    Equivalent to specifying both --locked and --offline.

    +
    --lockfile-path PATH
    -
    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with +

    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with Cargo.lock (e.g. --lockfile-path /tmp/temporary-lockfile/Cargo.lock). Note that providing --lockfile-path will ignore existing lockfile at the default path, and instead will either use the lockfile from PATH, or write a new lockfile into the provided PATH if it doesn’t exist. @@ -159,7 +173,8 @@ This flag can be used to run most commands in read-only directories, writing loc

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#14421).

    +#14421).

    +
    @@ -169,37 +184,42 @@ requires the -Z unstable-options flag to enable (see
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    diff --git a/src/doc/src/commands/cargo-vendor.md b/src/doc/src/commands/cargo-vendor.md index 4a09e91a6eb..0b0e8cdf1eb 100644 --- a/src/doc/src/commands/cargo-vendor.md +++ b/src/doc/src/commands/cargo-vendor.md @@ -35,26 +35,30 @@ as it knows that it is no longer a read-only dependency.
    -s manifest
    --sync manifest
    -
    Specify an extra Cargo.toml manifest to workspaces which should also be -vendored and synced to the output. May be specified multiple times.
    +

    Specify an extra Cargo.toml manifest to workspaces which should also be +vendored and synced to the output. May be specified multiple times.

    +
    --no-delete
    -
    Don’t delete the “vendor” directory when vendoring, but rather keep all -existing contents of the vendor directory
    +

    Don’t delete the “vendor” directory when vendoring, but rather keep all +existing contents of the vendor directory

    +
    --respect-source-config
    -
    Instead of ignoring [source] configuration by default in .cargo/config.toml -read it and use it when downloading crates from crates.io, for example
    +

    Instead of ignoring [source] configuration by default in .cargo/config.toml +read it and use it when downloading crates from crates.io, for example

    +
    --versioned-dirs
    -
    Normally versions are only added to disambiguate multiple versions of the +

    Normally versions are only added to disambiguate multiple versions of the same package. This option causes all directories in the “vendor” directory to be versioned, which makes it easier to track the history of vendored packages over time, and can help with the performance of re-vendoring when -only a subset of the packages have changed.

    +only a subset of the packages have changed.

    + @@ -64,12 +68,13 @@ only a subset of the packages have changed.
    --manifest-path path
    -
    Path to the Cargo.toml file. By default, Cargo searches for the -Cargo.toml file in the current directory or any parent directory.
    +

    Path to the Cargo.toml file. By default, Cargo searches for the +Cargo.toml file in the current directory or any parent directory.

    +
    --locked
    -
    Asserts that the exact same dependencies and versions are used as when the +

    Asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of the following scenarios arises:

      @@ -77,11 +82,12 @@ error when either of the following scenarios arises:

    • Cargo attempted to change the lock file due to a different dependency resolution.

    It may be used in environments where deterministic builds are desired, -such as in CI pipelines.

    +such as in CI pipelines.

    +
    --offline
    -
    Prevents Cargo from accessing the network for any reason. Without this +

    Prevents Cargo from accessing the network for any reason. Without this flag, Cargo will stop with an error if it needs to access the network and the network is not available. With this flag, Cargo will attempt to proceed without the network if possible.

    @@ -90,15 +96,17 @@ mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. See the cargo-fetch(1) command to download dependencies before going offline.

    -

    May also be specified with the net.offline config value.

    +

    May also be specified with the net.offline config value.

    +
    --frozen
    -
    Equivalent to specifying both --locked and --offline.
    +

    Equivalent to specifying both --locked and --offline.

    +
    --lockfile-path PATH
    -
    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with +

    Changes the path of the lockfile from the default (<workspace_root>/Cargo.lock) to PATH. PATH must end with Cargo.lock (e.g. --lockfile-path /tmp/temporary-lockfile/Cargo.lock). Note that providing --lockfile-path will ignore existing lockfile at the default path, and instead will either use the lockfile from PATH, or write a new lockfile into the provided PATH if it doesn’t exist. @@ -106,7 +114,8 @@ This flag can be used to run most commands in read-only directories, writing loc

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#14421).

    +#14421).

    +
    @@ -117,21 +126,23 @@ requires the -Z unstable-options flag to enable (see
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    May also be specified with the term.color -config value.

    +config value.

    + @@ -149,37 +161,42 @@ terminal.
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    diff --git a/src/doc/src/commands/cargo-version.md b/src/doc/src/commands/cargo-version.md index e9e12a05f79..c58dfeb74a3 100644 --- a/src/doc/src/commands/cargo-version.md +++ b/src/doc/src/commands/cargo-version.md @@ -18,7 +18,8 @@ Displays the version of Cargo.
    -v
    --verbose
    -
    Display additional version information.
    +

    Display additional version information.

    +
    diff --git a/src/doc/src/commands/cargo-yank.md b/src/doc/src/commands/cargo-yank.md index 0c505205ce3..f7a499c38ee 100644 --- a/src/doc/src/commands/cargo-yank.md +++ b/src/doc/src/commands/cargo-yank.md @@ -83,33 +83,38 @@ from keeping or even spreading the leaked credentials.
    --vers version
    --version version
    -
    The version to yank or un-yank.
    +

    The version to yank or un-yank.

    +
    --undo
    -
    Undo a yank, putting a version back into the index.
    +

    Undo a yank, putting a version back into the index.

    +
    --token token
    -
    API token to use when authenticating. This overrides the token stored in +

    API token to use when authenticating. This overrides the token stored in the credentials file (which is created by cargo-login(1)).

    Cargo config environment variables can be used to override the tokens stored in the credentials file. The token for crates.io may be specified with the CARGO_REGISTRY_TOKEN environment variable. Tokens for other registries may be specified with environment variables of the form CARGO_REGISTRIES_NAME_TOKEN where NAME is the name -of the registry in all capital letters.

    +of the registry in all capital letters.

    +
    --index index
    -
    The URL of the registry index to use.
    +

    The URL of the registry index to use.

    +
    --registry registry
    -
    Name of the registry to use. Registry names are defined in Cargo config +

    Name of the registry to use. Registry names are defined in Cargo config files. If not specified, the default registry is used, which is defined by the registry.default config key which defaults to -crates-io.

    +crates-io.

    + @@ -120,21 +125,23 @@ which is defined by the registry.default config key which defaults
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    May also be specified with the term.color -config value.

    +config value.

    + @@ -152,37 +160,42 @@ terminal.
    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    diff --git a/src/doc/src/commands/cargo.md b/src/doc/src/commands/cargo.md index 7a30397250f..675de3373cb 100644 --- a/src/doc/src/commands/cargo.md +++ b/src/doc/src/commands/cargo.md @@ -139,18 +139,21 @@ available at .
    -V
    --version
    -
    Print version info and exit. If used with --verbose, prints extra -information.
    +

    Print version info and exit. If used with --verbose, prints extra +information.

    +
    --list
    -
    List all installed Cargo subcommands. If used with --verbose, prints extra -information.
    +

    List all installed Cargo subcommands. If used with --verbose, prints extra +information.

    +
    --explain code
    -
    Run rustc --explain CODE which will print out a detailed explanation of an -error message (for example, E0004).
    +

    Run rustc --explain CODE which will print out a detailed explanation of an +error message (for example, E0004).

    +
    @@ -161,21 +164,23 @@ error message (for example, E0004).
    -v
    --verbose
    -
    Use verbose output. May be specified twice for “very verbose” output which +

    Use verbose output. May be specified twice for “very verbose” output which includes extra output such as dependency warnings and build script output. May also be specified with the term.verbose -config value.

    +config value.

    +
    -q
    --quiet
    -
    Do not print cargo log messages. +

    Do not print cargo log messages. May also be specified with the term.quiet -config value.

    +config value.

    +
    --color when
    -
    Control when colored output is used. Valid values:

    +

    Control when colored output is used. Valid values:

    • auto (default): Automatically detect if color support is available on the terminal.
    • @@ -183,7 +188,8 @@ terminal.
    • never: Never display colors.

    May also be specified with the term.color -config value.

    +config value.

    + @@ -192,7 +198,7 @@ terminal.
    --locked
    -
    Asserts that the exact same dependencies and versions are used as when the +

    Asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of the following scenarios arises:

      @@ -200,11 +206,12 @@ error when either of the following scenarios arises:

    • Cargo attempted to change the lock file due to a different dependency resolution.

    It may be used in environments where deterministic builds are desired, -such as in CI pipelines.

    +such as in CI pipelines.

    +
    --offline
    -
    Prevents Cargo from accessing the network for any reason. Without this +

    Prevents Cargo from accessing the network for any reason. Without this flag, Cargo will stop with an error if it needs to access the network and the network is not available. With this flag, Cargo will attempt to proceed without the network if possible.

    @@ -213,11 +220,13 @@ mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. See the cargo-fetch(1) command to download dependencies before going offline.

    -

    May also be specified with the net.offline config value.

    +

    May also be specified with the net.offline config value.

    +
    --frozen
    -
    Equivalent to specifying both --locked and --offline.
    +

    Equivalent to specifying both --locked and --offline.

    +
    @@ -226,37 +235,42 @@ offline.

    +toolchain
    -
    If Cargo has been installed with rustup, and the first argument to cargo +

    If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustup documentation -for more information about how toolchain overrides work.

    +for more information about how toolchain overrides work.

    +
    --config KEY=VALUE or PATH
    -
    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, +

    Overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. -See the command-line overrides section for more information.

    +See the command-line overrides section for more information.

    +
    -C PATH
    -
    Changes the current working directory before executing any specified operations. This affects +

    Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, for example cargo -C path/to/my-project build.

    This option is only available on the nightly channel and requires the -Z unstable-options flag to enable (see -#10098).

    +#10098).

    +
    -h
    --help
    -
    Prints help information.
    +

    Prints help information.

    +
    -Z flag
    -
    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.
    +

    Unstable (nightly-only) flags to Cargo. Run cargo -Z help for details.

    +
    diff --git a/src/doc/theme/cargo.css b/src/doc/theme/cargo.css new file mode 100644 index 00000000000..28748ad1651 --- /dev/null +++ b/src/doc/theme/cargo.css @@ -0,0 +1,5 @@ +dd > p { + /* For loose definitions that have a p tag inside, don't add a bunch of + space before the definition. This can removed after updating to mdbook 0.5. */ + margin-top: 0; +}