#macro #proc-macro #compilation

macro compile-time

Macros for getting compile time information

2 unstable releases

0.2.0 Jul 1, 2023
0.1.0 Jun 30, 2023

#754 in Procedural macros

Download history 3884/week @ 2025-10-20 4017/week @ 2025-10-27 4458/week @ 2025-11-03 4813/week @ 2025-11-10 5330/week @ 2025-11-17 3774/week @ 2025-11-24 3732/week @ 2025-12-01 3897/week @ 2025-12-08 3368/week @ 2025-12-15 2125/week @ 2025-12-22 2153/week @ 2025-12-29 2870/week @ 2026-01-05 1864/week @ 2026-01-12 2146/week @ 2026-01-19 2434/week @ 2026-01-26 4676/week @ 2026-02-02

11,358 downloads per month
Used in 8 crates (4 directly)

MIT/Apache

14KB
181 lines

compile-time

Crates.io Documentation

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.

Example

let compile_datetime = compile_time::datetime_str!();
let rustc_version = compile_time::rustc_version_str!();

println!("Compiled using Rust {rustc_version} on {compile_datetime}.");

Dependencies

~1MB
~23K SLoC