Skip to content

Commit

Permalink
Clarify the difference between CARGO_CRATE_NAME and CARGO_PKG_NAME
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-zero committed Jan 20, 2023
1 parent 975817b commit d8a3951
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/doc/src/reference/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ corresponding environment variable is set to the empty string, `""`.
* `CARGO_PKG_RUST_VERSION` — The Rust version from the manifest of your package.
Note that this is the minimum Rust version supported by the package, not the
current Rust version.
* `CARGO_CRATE_NAME` — The name of the crate that is currently being compiled.
* `CARGO_CRATE_NAME` — The name of the crate that is currently being compiled, it is the [Cargo target] with the `-` converted to `_`, such as the the name of the library, binary, example, integration test, or benchmark.
* `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`.
* `OUT_DIR` — If the package has a build script, this is set to the folder where the build
script should place its output. See below for more information.
Expand All @@ -255,6 +255,7 @@ corresponding environment variable is set to the empty string, `""`.
the tests/benches. Cargo initially creates this directory but doesn't
manage its content in any way, this is the responsibility of the test code.

[cargo target]: cargo-targets.md
[integration test]: cargo-targets.md#integration-tests
[`env` macro]: ../../std/macro.env.html

Expand Down

0 comments on commit d8a3951

Please sign in to comment.