Skip to content

Commit

Permalink
Add note about cargo:rustc-env variables set at runtime.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Feb 3, 2021
1 parent d8673d9 commit 1607a68
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/doc/src/reference/build-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,12 @@ unique identifier of a continuous integration server.
See also the [environment variables automatically included by
Cargo][env-cargo].

> **Note**: These environment variables are also set when running an
> executable with `cargo run` or `cargo test`. However, this usage is
> discouraged since it ties the executable to Cargo's execution environment.
> Normally, these environment variables should only be checked at compile-time
> with the `env!` macro.
[env-macro]: ../../std/macro.env.html
[env-cargo]: environment-variables.md#environment-variables-cargo-sets-for-crates

Expand Down

0 comments on commit 1607a68

Please sign in to comment.