@@ -49,7 +49,7 @@ system:
49
49
* ` TERM ` — If this is set to ` dumb ` , it disables the progress bar.
50
50
* ` BROWSER ` — The web browser to execute to open documentation with [ `cargo
51
51
doc` ]'s' ` --open` flag.
52
- * ` RUSTFMT ` — Instead of running ` rustfmt ` ,
52
+ * ` RUSTFMT ` — Instead of running ` rustfmt ` ,
53
53
[ ` cargo fmt ` ] ( https://github.com/rust-lang/rustfmt ) will execute this specified
54
54
` rustfmt ` instance instead.
55
55
@@ -206,6 +206,12 @@ let version = env!("CARGO_PKG_VERSION");
206
206
example, ` CARGO_BIN_EXE_my-program ` for a binary named ` my-program ` .
207
207
Binaries are automatically built when the test is built, unless the binary
208
208
has required features that are not enabled.
209
+ * ` CARGO_PRIMARY_PACKAGE ` — This environment variable will be set if the
210
+ package being built is primary. Primary packages are the ones the user
211
+ selected on the command-line, either with ` -p ` flags or the defaults based
212
+ on the current directory and the default workspace members. This environment
213
+ variable will not be set when building dependencies. This is only set when
214
+ compiling the package (not when running binaries or tests).
209
215
210
216
[ integration test ] : cargo-targets.md#integration-tests
211
217
[ `env` macro ] : ../../std/macro.env.html
@@ -266,12 +272,6 @@ let out_dir = env::var("OUT_DIR").unwrap();
266
272
Currently Cargo doesn't set the ` MAKEFLAGS ` variable,
267
273
but it's free for build scripts invoking GNU Make
268
274
to set it to the contents of ` CARGO_MAKEFLAGS ` .
269
- * ` CARGO_PRIMARY_PACKAGE ` — This environment variable will be set if the package being
270
- built is primary. Primary packages are the ones the user
271
- selected on the command-line, either with ` -p ` flags or
272
- the defaults based on the current directory and the default
273
- workspace members.
274
- This environment variable will not be set when building dependencies.
275
275
* ` CARGO_FEATURE_<name> ` — For each activated feature of the package being
276
276
built, this environment variable will be present
277
277
where ` <name> ` is the name of the feature uppercased
0 commit comments