Skip to content

Commit a21db62

Browse files
committed
don't put version into ProductDescription
set product description to "Rust Compiler" or "Rust Compiler (channel)" for non-stable channels
1 parent 6886e5b commit a21db62

File tree

1 file changed

+9
-1
lines changed
  • compiler/rustc_windows_rc/src

1 file changed

+9
-1
lines changed

compiler/rustc_windows_rc/src/lib.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ pub fn compile_windows_resource_file(
4444

4545
// This is just "major.minor.patch" and a "-dev", "-nightly" or similar suffix
4646
let rel_version = env::var("CFG_RELEASE").unwrap();
47-
let product_name = format!("Rust {}", &rel_version);
47+
48+
let product_name = product_name(env::var("CFG_RELEASE_CHANNEL").unwrap());
4849

4950
// remove the suffix, if present and parse into [`ResourceVersion`]
5051
let version = parse_version(rel_version.split("-").next().unwrap_or("0.0.0"))
@@ -80,6 +81,13 @@ pub fn compile_windows_resource_file(
8081
res_path
8182
}
8283

84+
fn product_name(channel: String) -> String {
85+
format!(
86+
"Rust Compiler{}",
87+
if channel == "stable" { "".to_string() } else { format!(" ({})", channel) }
88+
)
89+
}
90+
8391
/// Windows resources store versions as four 16-bit integers.
8492
struct ResourceVersion {
8593
major: u16,

0 commit comments

Comments
 (0)