From b67e591e36a8967cb5763aecba347504057553b9 Mon Sep 17 00:00:00 2001
From: Weihang Lo
Date: Fri, 19 Feb 2021 22:00:15 +0800
Subject: [PATCH 1/4] doc(man): add temp-target-dir variable
---
src/doc/man/cargo-install.md | 1 +
src/doc/man/includes/options-target-dir.md | 7 +++++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/doc/man/cargo-install.md b/src/doc/man/cargo-install.md
index 3e1bc02fe..95f550021 100644
--- a/src/doc/man/cargo-install.md
+++ b/src/doc/man/cargo-install.md
@@ -1,5 +1,6 @@
# cargo-install(1)
{{*set actionverb="Install"}}
+{{*set temp-target-dir=true}}
## NAME
diff --git a/src/doc/man/includes/options-target-dir.md b/src/doc/man/includes/options-target-dir.md
index 009790425..b3117fcf4 100644
--- a/src/doc/man/includes/options-target-dir.md
+++ b/src/doc/man/includes/options-target-dir.md
@@ -1,6 +1,9 @@
{{#option "`--target-dir` _directory_"}}
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](../reference/config.html). Defaults
-to `target` in the root of the workspace.
+`build.target-dir` [config value](../reference/config.html).
+{{#if temp-target-dir}} Defaults to a new temporary folder located in the
+temporary directory of the platform.
+{{else}} Defaults to `target` in the root of the workspace.
+{{/if}}
{{/option}}
From ee53210f9ef419d6635b4137183072dc796f2edd Mon Sep 17 00:00:00 2001
From: Weihang Lo
Date: Fri, 19 Feb 2021 22:00:57 +0800
Subject: [PATCH 2/4] doc: generated by build-man.sh
---
src/doc/man/generated_txt/cargo-install.txt | 3 ++-
src/doc/src/commands/cargo-bench.md | 4 ++--
src/doc/src/commands/cargo-build.md | 4 ++--
src/doc/src/commands/cargo-check.md | 4 ++--
src/doc/src/commands/cargo-clean.md | 4 ++--
src/doc/src/commands/cargo-doc.md | 4 ++--
src/doc/src/commands/cargo-fix.md | 4 ++--
src/doc/src/commands/cargo-install.md | 6 ++++--
src/doc/src/commands/cargo-package.md | 4 ++--
src/doc/src/commands/cargo-publish.md | 4 ++--
src/doc/src/commands/cargo-run.md | 4 ++--
src/doc/src/commands/cargo-rustc.md | 4 ++--
src/doc/src/commands/cargo-rustdoc.md | 4 ++--
src/doc/src/commands/cargo-test.md | 4 ++--
src/etc/man/cargo-bench.1 | 4 ++--
src/etc/man/cargo-build.1 | 4 ++--
src/etc/man/cargo-check.1 | 4 ++--
src/etc/man/cargo-clean.1 | 4 ++--
src/etc/man/cargo-doc.1 | 4 ++--
src/etc/man/cargo-fix.1 | 4 ++--
src/etc/man/cargo-install.1 | 5 +++--
src/etc/man/cargo-package.1 | 4 ++--
src/etc/man/cargo-publish.1 | 4 ++--
src/etc/man/cargo-run.1 | 4 ++--
src/etc/man/cargo-rustc.1 | 4 ++--
src/etc/man/cargo-rustdoc.1 | 4 ++--
src/etc/man/cargo-test.1 | 4 ++--
27 files changed, 57 insertions(+), 53 deletions(-)
diff --git a/src/doc/man/generated_txt/cargo-install.txt b/src/doc/man/generated_txt/cargo-install.txt
index a56e1797a..771849288 100644
--- a/src/doc/man/generated_txt/cargo-install.txt
+++ b/src/doc/man/generated_txt/cargo-install.txt
@@ -190,7 +190,8 @@ OPTIONS
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.
+ a new temporary folder located in the temporary directory of the
+ platform.
--debug
Build with the dev profile instead the release profile.
diff --git a/src/doc/src/commands/cargo-bench.md b/src/doc/src/commands/cargo-bench.md
index 36c4d7f97..74b3d496a 100644
--- a/src/doc/src/commands/cargo-bench.md
+++ b/src/doc/src/commands/cargo-bench.md
@@ -250,8 +250,8 @@ target artifacts are placed in a separate directory. See the
--target-dir
directory
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.
+build.target-dir
config value.
+Defaults to target
in the root of the workspace.
diff --git a/src/doc/src/commands/cargo-build.md b/src/doc/src/commands/cargo-build.md
index f99d7b3f8..eda9cf0ed 100644
--- a/src/doc/src/commands/cargo-build.md
+++ b/src/doc/src/commands/cargo-build.md
@@ -196,8 +196,8 @@ selection.
--target-dir
directory
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.
+build.target-dir
config value.
+Defaults to target
in the root of the workspace.
diff --git a/src/doc/src/commands/cargo-check.md b/src/doc/src/commands/cargo-check.md
index f2c0a891b..421e5677c 100644
--- a/src/doc/src/commands/cargo-check.md
+++ b/src/doc/src/commands/cargo-check.md
@@ -210,8 +210,8 @@ used.
--target-dir
directory
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.
+build.target-dir
config value.
+Defaults to target
in the root of the workspace.
diff --git a/src/doc/src/commands/cargo-clean.md b/src/doc/src/commands/cargo-clean.md
index 204307a3e..33d6dc0e9 100644
--- a/src/doc/src/commands/cargo-clean.md
+++ b/src/doc/src/commands/cargo-clean.md
@@ -47,8 +47,8 @@ the target directory.
--target-dir
directory
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.
+build.target-dir
config value.
+Defaults to target
in the root of the workspace.
diff --git a/src/doc/src/commands/cargo-doc.md b/src/doc/src/commands/cargo-doc.md
index 152198918..7640416f9 100644
--- a/src/doc/src/commands/cargo-doc.md
+++ b/src/doc/src/commands/cargo-doc.md
@@ -167,8 +167,8 @@ selection.
--target-dir
directory
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.
+build.target-dir
config value.
+Defaults to target
in the root of the workspace.
diff --git a/src/doc/src/commands/cargo-fix.md b/src/doc/src/commands/cargo-fix.md
index eca6e68f0..19b5d3e34 100644
--- a/src/doc/src/commands/cargo-fix.md
+++ b/src/doc/src/commands/cargo-fix.md
@@ -270,8 +270,8 @@ used.
--target-dir
directory
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.
+build.target-dir
config value.
+Defaults to target
in the root of the workspace.
diff --git a/src/doc/src/commands/cargo-install.md b/src/doc/src/commands/cargo-install.md
index b5d180363..03f8fa00d 100644
--- a/src/doc/src/commands/cargo-install.md
+++ b/src/doc/src/commands/cargo-install.md
@@ -1,6 +1,7 @@
# cargo-install(1)
+
## NAME
cargo-install - Build and install a Rust binary
@@ -215,8 +216,9 @@ target artifacts are placed in a separate directory. See the
--target-dir
directory
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.
+build.target-dir
config value.
+Defaults to a new temporary folder located in the
+temporary directory of the platform.
diff --git a/src/doc/src/commands/cargo-package.md b/src/doc/src/commands/cargo-package.md
index eca11d6e3..e0935bd61 100644
--- a/src/doc/src/commands/cargo-package.md
+++ b/src/doc/src/commands/cargo-package.md
@@ -88,8 +88,8 @@ target artifacts are placed in a separate directory. See the
--target-dir
directory
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.
+build.target-dir
config value.
+Defaults to target
in the root of the workspace.
diff --git a/src/doc/src/commands/cargo-publish.md b/src/doc/src/commands/cargo-publish.md
index 3f011423a..511688c1d 100644
--- a/src/doc/src/commands/cargo-publish.md
+++ b/src/doc/src/commands/cargo-publish.md
@@ -96,8 +96,8 @@ target artifacts are placed in a separate directory. See the
--target-dir
directory
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.
+build.target-dir
config value.
+Defaults to target
in the root of the workspace.
diff --git a/src/doc/src/commands/cargo-run.md b/src/doc/src/commands/cargo-run.md
index 93ede8f40..938d8ef4d 100644
--- a/src/doc/src/commands/cargo-run.md
+++ b/src/doc/src/commands/cargo-run.md
@@ -114,8 +114,8 @@ selection.
--target-dir
directory
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.
+build.target-dir
config value.
+Defaults to target
in the root of the workspace.
diff --git a/src/doc/src/commands/cargo-rustc.md b/src/doc/src/commands/cargo-rustc.md
index d085baca8..002ef1ac5 100644
--- a/src/doc/src/commands/cargo-rustc.md
+++ b/src/doc/src/commands/cargo-rustc.md
@@ -183,8 +183,8 @@ selection.
--target-dir
directory
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.
+build.target-dir
config value.
+Defaults to target
in the root of the workspace.
diff --git a/src/doc/src/commands/cargo-rustdoc.md b/src/doc/src/commands/cargo-rustdoc.md
index 173e0c2db..cbd3db6e8 100644
--- a/src/doc/src/commands/cargo-rustdoc.md
+++ b/src/doc/src/commands/cargo-rustdoc.md
@@ -196,8 +196,8 @@ selection.
--target-dir
directory
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.
+build.target-dir
config value.
+Defaults to target
in the root of the workspace.
diff --git a/src/doc/src/commands/cargo-test.md b/src/doc/src/commands/cargo-test.md
index 445af5961..8b4e2bd9c 100644
--- a/src/doc/src/commands/cargo-test.md
+++ b/src/doc/src/commands/cargo-test.md
@@ -276,8 +276,8 @@ selection.
--target-dir
directory
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.
+build.target-dir
config value.
+Defaults to target
in the root of the workspace.
diff --git a/src/etc/man/cargo-bench.1 b/src/etc/man/cargo-bench.1
index d08d2cf20..b91ee08ac 100644
--- a/src/etc/man/cargo-bench.1
+++ b/src/etc/man/cargo-bench.1
@@ -253,8 +253,8 @@ target artifacts are placed in a separate directory. See the
.RS 4
Directory for all generated artifacts and intermediate files. May also be
specified with the \fBCARGO_TARGET_DIR\fR environment variable, or the
-\fBbuild.target\-dir\fR \fIconfig value\fR \&. Defaults
-to \fBtarget\fR in the root of the workspace.
+\fBbuild.target\-dir\fR \fIconfig value\fR \&.
+Defaults to \fBtarget\fR in the root of the workspace.
.RE
.SS "Display Options"
By default the Rust test harness hides output from benchmark execution to keep
diff --git a/src/etc/man/cargo-build.1 b/src/etc/man/cargo-build.1
index d57a484f9..0750677b1 100644
--- a/src/etc/man/cargo-build.1
+++ b/src/etc/man/cargo-build.1
@@ -181,8 +181,8 @@ selection.
.RS 4
Directory for all generated artifacts and intermediate files. May also be
specified with the \fBCARGO_TARGET_DIR\fR environment variable, or the
-\fBbuild.target\-dir\fR \fIconfig value\fR \&. Defaults
-to \fBtarget\fR in the root of the workspace.
+\fBbuild.target\-dir\fR \fIconfig value\fR \&.
+Defaults to \fBtarget\fR in the root of the workspace.
.RE
.sp
\fB\-\-out\-dir\fR \fIdirectory\fR
diff --git a/src/etc/man/cargo-check.1 b/src/etc/man/cargo-check.1
index 276f9e720..453ca7fd7 100644
--- a/src/etc/man/cargo-check.1
+++ b/src/etc/man/cargo-check.1
@@ -195,8 +195,8 @@ used.
.RS 4
Directory for all generated artifacts and intermediate files. May also be
specified with the \fBCARGO_TARGET_DIR\fR environment variable, or the
-\fBbuild.target\-dir\fR \fIconfig value\fR \&. Defaults
-to \fBtarget\fR in the root of the workspace.
+\fBbuild.target\-dir\fR \fIconfig value\fR \&.
+Defaults to \fBtarget\fR in the root of the workspace.
.RE
.SS "Display Options"
.sp
diff --git a/src/etc/man/cargo-clean.1 b/src/etc/man/cargo-clean.1
index 8b33ef9e0..0836166e6 100644
--- a/src/etc/man/cargo-clean.1
+++ b/src/etc/man/cargo-clean.1
@@ -40,8 +40,8 @@ Clean all artifacts that were built with the \fBrelease\fR or \fBbench\fR profil
.RS 4
Directory for all generated artifacts and intermediate files. May also be
specified with the \fBCARGO_TARGET_DIR\fR environment variable, or the
-\fBbuild.target\-dir\fR \fIconfig value\fR \&. Defaults
-to \fBtarget\fR in the root of the workspace.
+\fBbuild.target\-dir\fR \fIconfig value\fR \&.
+Defaults to \fBtarget\fR in the root of the workspace.
.RE
.sp
\fB\-\-target\fR \fItriple\fR
diff --git a/src/etc/man/cargo-doc.1 b/src/etc/man/cargo-doc.1
index 1f9bc3840..36856d968 100644
--- a/src/etc/man/cargo-doc.1
+++ b/src/etc/man/cargo-doc.1
@@ -146,8 +146,8 @@ selection.
.RS 4
Directory for all generated artifacts and intermediate files. May also be
specified with the \fBCARGO_TARGET_DIR\fR environment variable, or the
-\fBbuild.target\-dir\fR \fIconfig value\fR \&. Defaults
-to \fBtarget\fR in the root of the workspace.
+\fBbuild.target\-dir\fR \fIconfig value\fR \&.
+Defaults to \fBtarget\fR in the root of the workspace.
.RE
.SS "Display Options"
.sp
diff --git a/src/etc/man/cargo-fix.1 b/src/etc/man/cargo-fix.1
index 97983d882..802e05416 100644
--- a/src/etc/man/cargo-fix.1
+++ b/src/etc/man/cargo-fix.1
@@ -268,8 +268,8 @@ used.
.RS 4
Directory for all generated artifacts and intermediate files. May also be
specified with the \fBCARGO_TARGET_DIR\fR environment variable, or the
-\fBbuild.target\-dir\fR \fIconfig value\fR \&. Defaults
-to \fBtarget\fR in the root of the workspace.
+\fBbuild.target\-dir\fR \fIconfig value\fR \&.
+Defaults to \fBtarget\fR in the root of the workspace.
.RE
.SS "Display Options"
.sp
diff --git a/src/etc/man/cargo-install.1 b/src/etc/man/cargo-install.1
index a755481fa..4d4407e71 100644
--- a/src/etc/man/cargo-install.1
+++ b/src/etc/man/cargo-install.1
@@ -246,8 +246,9 @@ target artifacts are placed in a separate directory. See the
.RS 4
Directory for all generated artifacts and intermediate files. May also be
specified with the \fBCARGO_TARGET_DIR\fR environment variable, or the
-\fBbuild.target\-dir\fR \fIconfig value\fR \&. Defaults
-to \fBtarget\fR in the root of the workspace.
+\fBbuild.target\-dir\fR \fIconfig value\fR \&.
+Defaults to a new temporary folder located in the
+temporary directory of the platform.
.RE
.sp
\fB\-\-debug\fR
diff --git a/src/etc/man/cargo-package.1 b/src/etc/man/cargo-package.1
index c2276e782..9fbce0bc0 100644
--- a/src/etc/man/cargo-package.1
+++ b/src/etc/man/cargo-package.1
@@ -112,8 +112,8 @@ target artifacts are placed in a separate directory. See the
.RS 4
Directory for all generated artifacts and intermediate files. May also be
specified with the \fBCARGO_TARGET_DIR\fR environment variable, or the
-\fBbuild.target\-dir\fR \fIconfig value\fR \&. Defaults
-to \fBtarget\fR in the root of the workspace.
+\fBbuild.target\-dir\fR \fIconfig value\fR \&.
+Defaults to \fBtarget\fR in the root of the workspace.
.RE
.SS "Feature Selection"
The feature flags allow you to control which features are enabled. When no
diff --git a/src/etc/man/cargo-publish.1 b/src/etc/man/cargo-publish.1
index 33920279f..04c2307ce 100644
--- a/src/etc/man/cargo-publish.1
+++ b/src/etc/man/cargo-publish.1
@@ -103,8 +103,8 @@ target artifacts are placed in a separate directory. See the
.RS 4
Directory for all generated artifacts and intermediate files. May also be
specified with the \fBCARGO_TARGET_DIR\fR environment variable, or the
-\fBbuild.target\-dir\fR \fIconfig value\fR \&. Defaults
-to \fBtarget\fR in the root of the workspace.
+\fBbuild.target\-dir\fR \fIconfig value\fR \&.
+Defaults to \fBtarget\fR in the root of the workspace.
.RE
.SS "Feature Selection"
The feature flags allow you to control which features are enabled. When no
diff --git a/src/etc/man/cargo-run.1 b/src/etc/man/cargo-run.1
index 6979d7573..6dee945b1 100644
--- a/src/etc/man/cargo-run.1
+++ b/src/etc/man/cargo-run.1
@@ -92,8 +92,8 @@ selection.
.RS 4
Directory for all generated artifacts and intermediate files. May also be
specified with the \fBCARGO_TARGET_DIR\fR environment variable, or the
-\fBbuild.target\-dir\fR \fIconfig value\fR \&. Defaults
-to \fBtarget\fR in the root of the workspace.
+\fBbuild.target\-dir\fR \fIconfig value\fR \&.
+Defaults to \fBtarget\fR in the root of the workspace.
.RE
.SS "Display Options"
.sp
diff --git a/src/etc/man/cargo-rustc.1 b/src/etc/man/cargo-rustc.1
index 332ab85f4..88d8d7d6e 100644
--- a/src/etc/man/cargo-rustc.1
+++ b/src/etc/man/cargo-rustc.1
@@ -167,8 +167,8 @@ selection.
.RS 4
Directory for all generated artifacts and intermediate files. May also be
specified with the \fBCARGO_TARGET_DIR\fR environment variable, or the
-\fBbuild.target\-dir\fR \fIconfig value\fR \&. Defaults
-to \fBtarget\fR in the root of the workspace.
+\fBbuild.target\-dir\fR \fIconfig value\fR \&.
+Defaults to \fBtarget\fR in the root of the workspace.
.RE
.SS "Display Options"
.sp
diff --git a/src/etc/man/cargo-rustdoc.1 b/src/etc/man/cargo-rustdoc.1
index b483e8e95..2845cf9d6 100644
--- a/src/etc/man/cargo-rustdoc.1
+++ b/src/etc/man/cargo-rustdoc.1
@@ -176,8 +176,8 @@ selection.
.RS 4
Directory for all generated artifacts and intermediate files. May also be
specified with the \fBCARGO_TARGET_DIR\fR environment variable, or the
-\fBbuild.target\-dir\fR \fIconfig value\fR \&. Defaults
-to \fBtarget\fR in the root of the workspace.
+\fBbuild.target\-dir\fR \fIconfig value\fR \&.
+Defaults to \fBtarget\fR in the root of the workspace.
.RE
.SS "Display Options"
.sp
diff --git a/src/etc/man/cargo-test.1 b/src/etc/man/cargo-test.1
index d1402af95..6ce5f90e1 100644
--- a/src/etc/man/cargo-test.1
+++ b/src/etc/man/cargo-test.1
@@ -277,8 +277,8 @@ selection.
.RS 4
Directory for all generated artifacts and intermediate files. May also be
specified with the \fBCARGO_TARGET_DIR\fR environment variable, or the
-\fBbuild.target\-dir\fR \fIconfig value\fR \&. Defaults
-to \fBtarget\fR in the root of the workspace.
+\fBbuild.target\-dir\fR \fIconfig value\fR \&.
+Defaults to \fBtarget\fR in the root of the workspace.
.RE
.SS "Display Options"
By default the Rust test harness hides output from test execution to keep
From c36e6bf131803bf405dc091869063c951bd3ae34 Mon Sep 17 00:00:00 2001
From: Weihang Lo
Date: Sat, 20 Feb 2021 11:31:09 +0800
Subject: [PATCH 3/4] doc(man): clarify `--path` influnce on `target-dir`
---
src/doc/man/includes/options-target-dir.md | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/doc/man/includes/options-target-dir.md b/src/doc/man/includes/options-target-dir.md
index b3117fcf4..3646e951f 100644
--- a/src/doc/man/includes/options-target-dir.md
+++ b/src/doc/man/includes/options-target-dir.md
@@ -3,7 +3,11 @@ 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](../reference/config.html).
{{#if temp-target-dir}} Defaults to a new temporary folder located in the
-temporary directory of the platform.
+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.
{{else}} Defaults to `target` in the root of the workspace.
{{/if}}
{{/option}}
From a70629235267abdb65eefa56ed1d1ea205224fb2 Mon Sep 17 00:00:00 2001
From: Weihang Lo
Date: Sat, 20 Feb 2021 11:33:23 +0800
Subject: [PATCH 4/4] doc: generated by build-man.sh
---
src/doc/man/generated_txt/cargo-install.txt | 3 +++
src/doc/src/commands/cargo-install.md | 5 ++++-
src/etc/man/cargo-install.1 | 6 +++++-
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/doc/man/generated_txt/cargo-install.txt b/src/doc/man/generated_txt/cargo-install.txt
index 771849288..ce009c0cb 100644
--- a/src/doc/man/generated_txt/cargo-install.txt
+++ b/src/doc/man/generated_txt/cargo-install.txt
@@ -193,6 +193,9 @@ OPTIONS
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.
+
--debug
Build with the dev profile instead the release profile.
diff --git a/src/doc/src/commands/cargo-install.md b/src/doc/src/commands/cargo-install.md
index 03f8fa00d..1639b28cb 100644
--- a/src/doc/src/commands/cargo-install.md
+++ b/src/doc/src/commands/cargo-install.md
@@ -218,7 +218,10 @@ target artifacts are placed in a separate directory. See the
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.
+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.
diff --git a/src/etc/man/cargo-install.1 b/src/etc/man/cargo-install.1
index 4d4407e71..1840182a2 100644
--- a/src/etc/man/cargo-install.1
+++ b/src/etc/man/cargo-install.1
@@ -248,7 +248,11 @@ Directory for all generated artifacts and intermediate files. May also be
specified with the \fBCARGO_TARGET_DIR\fR environment variable, or the
\fBbuild.target\-dir\fR \fIconfig value\fR \&.
Defaults to a new temporary folder located in the
-temporary directory of the platform.
+temporary directory of the platform.
+.sp
+When using \fB\-\-path\fR, by default it will use \fBtarget\fR directory in the workspace
+of the local crate unless \fB\-\-target\-dir\fR
+is specified.
.RE
.sp
\fB\-\-debug\fR