build

Macro rustc_env

source
macro_rules! rustc_env {
    ($($tokens:tt)*) => { ... };
}
Expand description

The rustc_env instruction tells Cargo to set the given environment variable when compiling the package. The value can be then retrieved by the env! macro in the compiled crate. This is useful for embedding additional metadata in crate’s code, such as the hash of git HEAD or the unique identifier of a continuous integration server.

See also the environment variables automatically included by Cargo.

For more information, see this cargo reference.