]> git.lizzy.rs Git - rust.git/commitdiff
Make rustfmt-bin's CARGO_PKG_VERSION envvar optional
authorAlex McArther <acmcarther@google.com>
Tue, 23 Jan 2018 15:55:50 +0000 (07:55 -0800)
committerAlex McArther <acmcarther@google.com>
Tue, 23 Jan 2018 15:55:50 +0000 (07:55 -0800)
src/bin/rustfmt.rs

index ba586e1fd913db3d6d5c82b08843c2b8af4ff936..5a9119cdb111b3bbb6f849d9c0a8e3090fabc1f7 100644 (file)
@@ -387,7 +387,7 @@ fn print_usage_to_stdout(opts: &Options, reason: &str) {
 fn print_version() {
     println!(
         "{}-nightly{}",
-        env!("CARGO_PKG_VERSION"),
+        option_env!("CARGO_PKG_VERSION").unwrap_or("unknown"),
         include_str!(concat!(env!("OUT_DIR"), "/commit-info.txt"))
     )
 }