diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-10-13 18:27:19 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-13 18:27:19 +0200 |
| commit | 022b327d86c8e0b4457ed61a0038c13ac12a98b0 (patch) | |
| tree | d34612871295c242f37e7fa985ad8eb37325f9c7 /src | |
| parent | 1d0c7cf49fcd826e6f61189adb2dee60c77ebe44 (diff) | |
| parent | d3ea0e4e13cfc1e0e2cddd50fd1e165ea131d57c (diff) | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/src/lib.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs index ecb219ea33f..3924a6d714e 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs @@ -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 } |
