Problem
The doc source for cargo update --breaking in doc/man/cargo-update.md (line 54) defines the option heading as:
{{#option "`--breaking` _directory_" }}
This renders in both the published Cargo Book (https://doc.rust-lang.org/cargo/commands/cargo-update.html) and the generated man page (doc/man/generated_txt/cargo-update.txt) as:
--breaking directory
Update spec to latest SemVer-breaking version.
This implies --breaking takes a directory value, but it's a plain boolean flag with no argument. Confirmed in src/bin/cargo/commands/update.rs, where --breaking is defined via the flag(...) helper (no value) and checked with args.flag("breaking"), the same pattern used by --recursive/--dry-run, which correctly show no metavar in the docs. Running cargo update --help also confirms no argument is expected:
-b, --breaking Update [SPEC] to latest SemVer-breaking version (unstable)
The description text under the doc entry itself never mentions a directory either — it only discusses updating spec's SemVer requirement.
Likely cause: _directory_ is a legitimate metavar used correctly elsewhere for path-taking flags (e.g. --artifact-dir, --target-dir), and appears to have been copy-pasted into the --breaking entry by mistake, possibly when the flag was added in #13979.
Steps
- View the "Options" section for
--breaking at https://doc.rust-lang.org/cargo/commands/cargo-update.html (or run cargo update --help/view the generated man page and compare)
- Note the doc heading reads
--breaking directory
- Compare against
cargo update --help output, which shows --breaking as a plain flag with no argument
Possible Solution(s)
Remove _directory_ from the option heading in doc/man/cargo-update.md line 54, changing:
{{#option "`--breaking` _directory_" }}
to:
{{#option "`--breaking`" }}
matching the style of sibling flags (--recursive, --dry-run, -w/--workspace) in the same file. Regenerate the derived docs (man page txt / book HTML) via the repo's existing doc-generation xtask so they stay in sync.
Notes
Not a duplicate of #12425 (tracking issue for the --breaking feature) or #14204/#14178 (behavioral complaints about how --breaking resolves prerelease versions). None of those address this doc rendering typo.
Version
cargo 1.92.0 (344c4567c 2025-10-21)
release: 1.92.0
commit-hash: 344c4567c634a25837e3c3476aac08af84cf9203
commit-date: 2025-10-21
host: x86_64-pc-windows-msvc
libgit2: 1.9.1 (sys:0.20.2 vendored)
libcurl: 8.15.0-DEV (sys:0.4.83+curl-8.15.0 vendored ssl:Schannel)
os: Windows 10.0.26200 (Windows 11 CoreSingleLanguage) [64-bit]
Problem
The doc source for
cargo update --breakingindoc/man/cargo-update.md(line 54) defines the option heading as:This renders in both the published Cargo Book (https://doc.rust-lang.org/cargo/commands/cargo-update.html) and the generated man page (
doc/man/generated_txt/cargo-update.txt) as:This implies
--breakingtakes adirectoryvalue, but it's a plain boolean flag with no argument. Confirmed insrc/bin/cargo/commands/update.rs, where--breakingis defined via theflag(...)helper (no value) and checked withargs.flag("breaking"), the same pattern used by--recursive/--dry-run, which correctly show no metavar in the docs. Runningcargo update --helpalso confirms no argument is expected:The description text under the doc entry itself never mentions a directory either — it only discusses updating
spec's SemVer requirement.Likely cause:
_directory_is a legitimate metavar used correctly elsewhere for path-taking flags (e.g.--artifact-dir,--target-dir), and appears to have been copy-pasted into the--breakingentry by mistake, possibly when the flag was added in #13979.Steps
--breakingat https://doc.rust-lang.org/cargo/commands/cargo-update.html (or runcargo update --help/view the generated man page and compare)--breaking directorycargo update --helpoutput, which shows--breakingas a plain flag with no argumentPossible Solution(s)
Remove
_directory_from the option heading indoc/man/cargo-update.mdline 54, changing:to:
matching the style of sibling flags (
--recursive,--dry-run,-w/--workspace) in the same file. Regenerate the derived docs (man page txt / book HTML) via the repo's existing doc-generation xtask so they stay in sync.Notes
Not a duplicate of #12425 (tracking issue for the
--breakingfeature) or #14204/#14178 (behavioral complaints about how--breakingresolves prerelease versions). None of those address this doc rendering typo.Version