Skip to content

Commit 022b327

Browse files
authored
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.
2 parents 1d0c7cf + d3ea0e4 commit 022b327

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/bootstrap/src/lib.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1575,9 +1575,11 @@ Executed at: {executed_at}"#,
15751575
fn rust_version(&self) -> String {
15761576
let mut version = self.rust_info().version(self, &self.version);
15771577
if let Some(ref s) = self.config.description {
1578-
version.push_str(" (");
1579-
version.push_str(s);
1580-
version.push(')');
1578+
if !s.is_empty() {
1579+
version.push_str(" (");
1580+
version.push_str(s);
1581+
version.push(')');
1582+
}
15811583
}
15821584
version
15831585
}

0 commit comments

Comments
 (0)