compile-time
This crate provides macros for getting compile time information.
You can get the compile time either as time::Date, time::Time,
time::OffsetDateTime, string, or UNIX timestamp.
You can get the Rust compiler version either as semver::Version or string,
and the individual version parts as integer literals or strings, respectively.
You can run arbitrary command at compile time and get its output as bytes or string.
Examples
Getting the compile time and Rust version:
const COMPILE_DATETIME: &str = datetime_str!;
const RUSTC_VERSION: &str = rustc_version_str!;
println!;
Running an arbitrary command at compile time:
const MAGIC_NUMBER: &str = command_str!;
assert_eq!;