about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2015-02-11 16:48:16 -0800
committerBrian Anderson <banderson@mozilla.com>2015-02-13 14:30:04 -0800
commiteffad62bc5d8a0733c60ebee5faf13c24e8ce148 (patch)
treeaa73d4695e86b70983a0a3f115e0e7b61c902b12 /src
parentd0e82a68a9bf32eff2509e9f2579c5aa0fc61e92 (diff)
downloadrust-effad62bc5d8a0733c60ebee5faf13c24e8ce148.tar.gz
rust-effad62bc5d8a0733c60ebee5faf13c24e8ce148.zip
Add the build date to the reported version. #21957
rustc --version says

```
rustc 1.0.0-dev (d0e82a68a 2015-02-05) (built 2015-02-11)
```
Diffstat (limited to 'src')
-rw-r--r--src/librustc_driver/lib.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs
index 9193debbe42..4e25033e973 100644
--- a/src/librustc_driver/lib.rs
+++ b/src/librustc_driver/lib.rs
@@ -276,6 +276,10 @@ pub fn commit_date_str() -> Option<&'static str> {
     option_env!("CFG_VER_DATE")
 }
 
+pub fn build_date_str() -> Option<&'static str> {
+    option_env!("CFG_BUILD_DATE")
+}
+
 /// Prints version information and returns None on success or an error
 /// message on panic.
 pub fn version(binary: &str, matches: &getopts::Matches) {
@@ -287,6 +291,7 @@ pub fn version(binary: &str, matches: &getopts::Matches) {
         println!("binary: {}", binary);
         println!("commit-hash: {}", unw(commit_hash_str()));
         println!("commit-date: {}", unw(commit_date_str()));
+        println!("build-date: {}", unw(build_date_str()));
         println!("host: {}", config::host_triple());
         println!("release: {}", unw(release_str()));
     }