mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Rollup merge of #130900 - capickett:empty-description-rust-version, r=albertlarsan68
Do not output () on empty description When passing an explicitly empty description string, as explained here https://github.com/rust-lang/rust/blob/master/config.example.toml#L611-L613, my expectation is that the resulting rustc will be compatible with upstream. However, it seems that instead, a `()` is added to the end of the version string, causing the version compatibility check to fail. My proposed fix here would be to instead only print `({description})` if `description` is a non-empty string.
This commit is contained in:
commit
022b327d86
@ -1575,9 +1575,11 @@ Executed at: {executed_at}"#,
|
||||
fn rust_version(&self) -> String {
|
||||
let mut version = self.rust_info().version(self, &self.version);
|
||||
if let Some(ref s) = self.config.description {
|
||||
version.push_str(" (");
|
||||
version.push_str(s);
|
||||
version.push(')');
|
||||
if !s.is_empty() {
|
||||
version.push_str(" (");
|
||||
version.push_str(s);
|
||||
version.push(')');
|
||||
}
|
||||
}
|
||||
version
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user