Skip to content

Commit 08ce17a

Browse files
authored
Rollup merge of #107876 - zephaniahong:issue-107547-fix, r=albertlarsan68
create symlink only for non-windows operating systems Follow up on #107834 It's my first time using the #cfg attribute. Did I use it correctly? Thank you!
2 parents a4c64b9 + d560574 commit 08ce17a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/bootstrap/download.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,12 @@ impl Config {
340340
let rustfmt_path = bin_root.join("bin").join(exe("rustfmt", host));
341341
let rustfmt_stamp = bin_root.join(".rustfmt-stamp");
342342

343-
let legacy_rustfmt = self.initial_rustc.with_file_name(exe("rustfmt", host));
344-
if !legacy_rustfmt.exists() {
345-
t!(self.symlink_file(&rustfmt_path, &legacy_rustfmt));
343+
#[cfg(not(windows))]
344+
{
345+
let legacy_rustfmt = self.initial_rustc.with_file_name(exe("rustfmt", host));
346+
if !legacy_rustfmt.exists() {
347+
t!(self.symlink_file(&rustfmt_path, &legacy_rustfmt));
348+
}
346349
}
347350

348351
if rustfmt_path.exists() && !program_out_of_date(&rustfmt_stamp, &channel) {

0 commit comments

Comments
 (0)