Skip to content

Commit

Permalink
Remove build date from version
Browse files Browse the repository at this point in the history
This was done by rustc awhile ago anyway and the rustc build system isn't
exporting it.
  • Loading branch information
alexcrichton committed Mar 12, 2017
1 parent 5f3b9c4 commit 7e6c83f
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/cargo/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ pub struct CommitInfo {
pub struct CfgInfo {
// Information about the git repository we may have been built from.
pub commit_info: Option<CommitInfo>,
// The date that the build was performed.
pub build_date: String,
// The release channel we were built for.
pub release_channel: String,
}
Expand Down Expand Up @@ -93,15 +91,9 @@ impl fmt::Display for VersionInfo {
};

if let Some(ref cfg) = self.cfg_info {
match cfg.commit_info {
Some(ref ci) => {
write!(f, " ({} {})",
ci.short_commit_hash, ci.commit_date)?;
},
None => {
write!(f, " (built {})",
cfg.build_date)?;
}
if let Some(ref ci) = cfg.commit_info {
write!(f, " ({} {})",
ci.short_commit_hash, ci.commit_date)?;
}
};
Ok(())
Expand Down Expand Up @@ -260,7 +252,6 @@ pub fn version() -> VersionInfo {
patch: env_str!("CARGO_PKG_VERSION_PATCH"),
pre_release: option_env_str!("CARGO_PKG_VERSION_PRE"),
cfg_info: Some(CfgInfo {
build_date: option_env_str!("CFG_BUILD_DATE").unwrap(),
release_channel: option_env_str!("CFG_RELEASE_CHANNEL").unwrap(),
commit_info: commit_info,
}),
Expand Down

2 comments on commit 7e6c83f

@jbethune
Copy link

@jbethune jbethune commented on 7e6c83f Mar 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit makes the shell command cargo version panic on nightly. Stable is fine. The command cargo by itself is also fine.

@tshepang
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops!

Please sign in to comment.