Skip to content

Commit e9f3733

Browse files
authored
Rollup merge of #96761 - klensy:no-rayon-here, r=CraftSpider
rustdoc: don't build `rayon` for non-windows targets `rayon` used only on windows targets, so no need to build it otherwise.
2 parents 78c709c + 7f11749 commit e9f3733

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/librustdoc/Cargo.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ askama = { version = "0.11", default-features = false, features = ["config"] }
1212
atty = "0.2"
1313
pulldown-cmark = { version = "0.9", default-features = false }
1414
minifier = "0.0.43"
15-
rayon = "1.5.1"
1615
serde = { version = "1.0", features = ["derive"] }
1716
serde_json = "1.0"
1817
smallvec = "1.6.1"
@@ -29,6 +28,9 @@ version = "0.3.3"
2928
default-features = false
3029
features = ["fmt", "env-filter", "smallvec", "parking_lot", "ansi"]
3130

31+
[target.'cfg(windows)'.dependencies]
32+
rayon = "1.5.1"
33+
3234
[dev-dependencies]
3335
expect-test = "1.0"
3436

src/librustdoc/docfs.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ impl DocFS {
5454
where
5555
E: PathError,
5656
{
57-
if !self.sync_only && cfg!(windows) {
57+
#[cfg(windows)]
58+
if !self.sync_only {
5859
// A possible future enhancement after more detailed profiling would
5960
// be to create the file sync so errors are reported eagerly.
6061
let sender = self.errors.clone().expect("can't write after closing");
@@ -68,6 +69,10 @@ impl DocFS {
6869
} else {
6970
fs::write(&path, contents).map_err(|e| E::new(e, path))?;
7071
}
72+
73+
#[cfg(not(windows))]
74+
fs::write(&path, contents).map_err(|e| E::new(e, path))?;
75+
7176
Ok(())
7277
}
7378
}

0 commit comments

Comments
 (0)