This commit is contained in:
arkpar 2016-03-17 18:43:01 +01:00
parent 3bf0a00ba4
commit 35be0e9943

View File

@ -26,12 +26,12 @@ use std::path::Path;
fn main() {
vergen(OutputFns::all()).unwrap();
let out_dir = env::var("OUT_DIR").unwrap();
let dest_path = Path::new(&out_dir).join("rustc_version.rs");
let mut f = File::create(&dest_path).unwrap();
let dest_path = Path::new(&out_dir).join("rustc_version.rs");
let mut f = File::create(&dest_path).unwrap();
f.write_all(format!("
/// Returns compiler version.
pub fn rustc_version() -> &'static str {{
pub fn rustc_version() -> &'static str {{
\"{}\"
}}
", rustc_version::version()).as_bytes()).unwrap();
}}
", rustc_version::version()).as_bytes()).unwrap();
}