Skip to content

Commit e678dbd

Browse files
committed
Clarify the difference between CARGO_CRATE_NAME and CARGO_PKG_NAME
1 parent 975817b commit e678dbd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/doc/src/reference/environment-variables.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ corresponding environment variable is set to the empty string, `""`.
231231
* `CARGO_PKG_RUST_VERSION` — The Rust version from the manifest of your package.
232232
Note that this is the minimum Rust version supported by the package, not the
233233
current Rust version.
234-
* `CARGO_CRATE_NAME` — The name of the crate that is currently being compiled.
234+
* `CARGO_CRATE_NAME` — The name of the crate that is currently being compiled. It is the name of the [Cargo target] the `-` converted to `_`, such as the name of the library, binary, example, integration test, or benchmark.
235235
* `CARGO_BIN_NAME` — The name of the binary that is currently being compiled (if it is a binary). This name does not include any file extension, such as `.exe`.
236236
* `OUT_DIR` — If the package has a build script, this is set to the folder where the build
237237
script should place its output. See below for more information.
@@ -255,6 +255,7 @@ corresponding environment variable is set to the empty string, `""`.
255255
the tests/benches. Cargo initially creates this directory but doesn't
256256
manage its content in any way, this is the responsibility of the test code.
257257

258+
[Cargo target]: cargo-targets.md
258259
[integration test]: cargo-targets.md#integration-tests
259260
[`env` macro]: ../../std/macro.env.html
260261

0 commit comments

Comments
 (0)