Skip to content

Commit 370a481

Browse files
committed
doc: mention binary auto-built for build,bench,test,rustc
1 parent 7860458 commit 370a481

15 files changed

+93
-7
lines changed

src/doc/man/cargo-bench.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ them from being benchmarked by default. Target selection options that take a
8181
target by name ignore the `bench` flag and will always benchmark the given
8282
target.
8383

84+
{{> options-targets-bin-auto-built }}
85+
8486
{{> options-targets }}
8587

8688
{{> section-features }}

src/doc/man/cargo-build.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ When no target selection options are given, `cargo build` will build all
2323
binary and library targets of the selected packages. Binaries are skipped if
2424
they have `required-features` that are missing.
2525

26+
{{> options-targets-bin-auto-built }}
27+
2628
{{> options-targets }}
2729

2830
{{> section-features }}

src/doc/man/cargo-rustc.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ To pass flags to all compiler processes spawned by Cargo, use the `RUSTFLAGS`
3535
When no target selection options are given, `cargo rustc` will build all
3636
binary and library targets of the selected package.
3737

38+
{{> options-targets-bin-auto-built }}
39+
3840
{{> options-targets }}
3941

4042
{{> section-features }}

src/doc/man/cargo-test.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,7 @@ ignore the `test` flag and will always test the given target.
7373
Doc tests for libraries may be disabled by setting `doctest = false` for the
7474
library in the manifest.
7575

76-
Binary targets are automatically built if there is an integration test or
77-
benchmark. This allows an integration test to execute the binary to exercise
78-
and test its behavior. The `CARGO_BIN_EXE_<name>`
79-
[environment variable](../reference/environment-variables.html#environment-variables-cargo-sets-for-crates)
80-
is set when the integration test is built so that it can use the
81-
[`env` macro](https://doc.rust-lang.org/std/macro.env.html) to locate the
82-
executable.
76+
{{> options-targets-bin-auto-built }}
8377

8478
{{> options-targets }}
8579

src/doc/man/generated_txt/cargo-bench.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,15 @@ OPTIONS
117117
options that take a target by name ignore the bench flag and will always
118118
benchmark the given target.
119119

120+
Binary targets are automatically built if there is an integration test
121+
or benchmark. This allows an integration test to execute the binary to
122+
exercise and test its behavior. The CARGO_BIN_EXE_<name> environment
123+
variable
124+
<https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-crates>
125+
is set when the integration test is built so that it can use the env
126+
macro <https://doc.rust-lang.org/std/macro.env.html> to locate the
127+
executable.
128+
120129
Passing target selection flags will benchmark only the specified
121130
targets.
122131

src/doc/man/generated_txt/cargo-build.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ OPTIONS
5151
binary and library targets of the selected packages. Binaries are
5252
skipped if they have required-features that are missing.
5353

54+
Binary targets are automatically built if there is an integration test
55+
or benchmark. This allows an integration test to execute the binary to
56+
exercise and test its behavior. The CARGO_BIN_EXE_<name> environment
57+
variable
58+
<https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-crates>
59+
is set when the integration test is built so that it can use the env
60+
macro <https://doc.rust-lang.org/std/macro.env.html> to locate the
61+
executable.
62+
5463
Passing target selection flags will build only the specified targets.
5564

5665
Note that --bin, --example, --test and --bench flags also support common

src/doc/man/generated_txt/cargo-rustc.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ OPTIONS
4242
When no target selection options are given, cargo rustc will build all
4343
binary and library targets of the selected package.
4444

45+
Binary targets are automatically built if there is an integration test
46+
or benchmark. This allows an integration test to execute the binary to
47+
exercise and test its behavior. The CARGO_BIN_EXE_<name> environment
48+
variable
49+
<https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-crates>
50+
is set when the integration test is built so that it can use the env
51+
macro <https://doc.rust-lang.org/std/macro.env.html> to locate the
52+
executable.
53+
4554
Passing target selection flags will build only the specified targets.
4655

4756
Note that --bin, --example, --test and --bench flags also support common
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Binary targets are automatically built if there is an integration test or
2+
benchmark. This allows an integration test to execute the binary to exercise
3+
and test its behavior. The `CARGO_BIN_EXE_<name>`
4+
[environment variable](../reference/environment-variables.html#environment-variables-cargo-sets-for-crates)
5+
is set when the integration test is built so that it can use the
6+
[`env` macro](https://doc.rust-lang.org/std/macro.env.html) to locate the
7+
executable.

src/doc/src/commands/cargo-bench.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,15 @@ them from being benchmarked by default. Target selection options that take a
138138
target by name ignore the `bench` flag and will always benchmark the given
139139
target.
140140

141+
Binary targets are automatically built if there is an integration test or
142+
benchmark. This allows an integration test to execute the binary to exercise
143+
and test its behavior. The `CARGO_BIN_EXE_<name>`
144+
[environment variable](../reference/environment-variables.html#environment-variables-cargo-sets-for-crates)
145+
is set when the integration test is built so that it can use the
146+
[`env` macro](https://doc.rust-lang.org/std/macro.env.html) to locate the
147+
executable.
148+
149+
141150
Passing target selection flags will benchmark only the specified
142151
targets.
143152

src/doc/src/commands/cargo-build.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,15 @@ When no target selection options are given, `cargo build` will build all
6666
binary and library targets of the selected packages. Binaries are skipped if
6767
they have `required-features` that are missing.
6868

69+
Binary targets are automatically built if there is an integration test or
70+
benchmark. This allows an integration test to execute the binary to exercise
71+
and test its behavior. The `CARGO_BIN_EXE_<name>`
72+
[environment variable](../reference/environment-variables.html#environment-variables-cargo-sets-for-crates)
73+
is set when the integration test is built so that it can use the
74+
[`env` macro](https://doc.rust-lang.org/std/macro.env.html) to locate the
75+
executable.
76+
77+
6978
Passing target selection flags will build only the specified
7079
targets.
7180

0 commit comments

Comments
 (0)