From ff9a9c83059d42dc48b1c3e3e3ac2ddad1914393 Mon Sep 17 00:00:00 2001 From: Ojus Chugh Date: Tue, 5 Aug 2025 02:15:54 +0530 Subject: [PATCH] fixed documentation, which fixes the concern raised in issue 15728 and regenerated pages using cargo build-man and ran ./ci/validate-man.sh --- src/doc/man/cargo-doc.md | 2 ++ src/doc/man/generated_txt/cargo-doc.txt | 4 ++++ src/doc/src/commands/cargo-doc.md | 2 ++ src/etc/man/cargo-doc.1 | 2 ++ 4 files changed, 10 insertions(+) diff --git a/src/doc/man/cargo-doc.md b/src/doc/man/cargo-doc.md index d5431df5d60..a176ea1c9b9 100644 --- a/src/doc/man/cargo-doc.md +++ b/src/doc/man/cargo-doc.md @@ -16,6 +16,8 @@ cargo-doc --- Build a package's documentation Build the documentation for the local package and all dependencies. The output is placed in `target/doc` in rustdoc's usual format. +**Note:** Documentation generation is cumulative: existing doc files in the target directory are preserved across different `cargo doc` invocations. To remove existing generated docs, pass `--doc` to {{man "cargo-clean" 1}}. + ## OPTIONS ### Documentation Options diff --git a/src/doc/man/generated_txt/cargo-doc.txt b/src/doc/man/generated_txt/cargo-doc.txt index 071663129c5..be5217bbf04 100644 --- a/src/doc/man/generated_txt/cargo-doc.txt +++ b/src/doc/man/generated_txt/cargo-doc.txt @@ -10,6 +10,10 @@ DESCRIPTION Build the documentation for the local package and all dependencies. The output is placed in target/doc in rustdoc’s usual format. + Note: Documentation generation is cumulative: existing doc files in the + target directory are preserved across different cargo doc invocations. + To remove existing generated docs, pass --doc to cargo-clean(1). + OPTIONS Documentation Options --open diff --git a/src/doc/src/commands/cargo-doc.md b/src/doc/src/commands/cargo-doc.md index 3b97a336692..ae7fb8d5390 100644 --- a/src/doc/src/commands/cargo-doc.md +++ b/src/doc/src/commands/cargo-doc.md @@ -12,6 +12,8 @@ cargo-doc --- Build a package's documentation Build the documentation for the local package and all dependencies. The output is placed in `target/doc` in rustdoc's usual format. +**Note:** Documentation generation is cumulative: existing doc files in the target directory are preserved across different `cargo doc` invocations. To remove existing generated docs, pass `--doc` to [cargo-clean(1)](cargo-clean.html). + ## OPTIONS ### Documentation Options diff --git a/src/etc/man/cargo-doc.1 b/src/etc/man/cargo-doc.1 index b236f12a84d..630cc9895dd 100644 --- a/src/etc/man/cargo-doc.1 +++ b/src/etc/man/cargo-doc.1 @@ -10,6 +10,8 @@ cargo\-doc \[em] Build a package\[cq]s documentation .SH "DESCRIPTION" Build the documentation for the local package and all dependencies. The output is placed in \fBtarget/doc\fR in rustdoc\[cq]s usual format. +.sp +\fBNote:\fR Documentation generation is cumulative: existing doc files in the target directory are preserved across different \fBcargo doc\fR invocations. To remove existing generated docs, pass \fB\-\-doc\fR to \fBcargo\-clean\fR(1). .SH "OPTIONS" .SS "Documentation Options" .sp