Skip to content

SkylerLipthay/build_epoch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

build_epoch

A simple Rust compiler plugin macro for generating an i64 specifying, in seconds, the time that the target crate was built in relation to epoch (1970-01-01T00:00:00Z).

#![feature(plugin)]
#![plugin(build_epoch)]

fn main() {
    // At the time of writing, this prints "1437740236":
    println!("{}", build_epoch!());
}

The static value of build_epoch!() is determined when the compiler expands its first occurrence.

About

Rust compiler plugin for calculating the epoch at compile time

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages