Skip to content

Commit e827f7f

Browse files
authored
Merge pull request #2087 from kinnison/kinnison/fix-no-target-components
manifest: Do not wrongly ascribe target to rust-src and friends
2 parents 57b0389 + bef6279 commit e827f7f

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/dist/manifest.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,16 @@ impl Manifest {
256256
let rust_pkg = self.get_package("rust")?.get_target(Some(target))?;
257257
let result = profile
258258
.iter()
259-
.filter(|s| {
260-
rust_pkg
261-
.components
262-
.iter()
263-
.any(|c| &c.pkg == *s && c.target.as_ref().map(|t| t == target).unwrap_or(true))
259+
.map(|s| {
260+
(
261+
s,
262+
rust_pkg.components.iter().find(|c| {
263+
&c.pkg == s && c.target.as_ref().map(|t| t == target).unwrap_or(true)
264+
}),
265+
)
264266
})
265-
.map(|s| Component::new(s.to_owned(), Some(target.clone()), false))
267+
.filter(|(_, c)| c.is_some())
268+
.map(|(s, c)| Component::new(s.to_owned(), c.and_then(|c| c.target.clone()), false))
266269
.collect();
267270
Ok(result)
268271
}

0 commit comments

Comments
 (0)