Skip to content

Commit 26f6f95

Browse files
committed
separate is_cross from target insert operations
1 parent afebe84 commit 26f6f95

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/cargo/core/compiler/build_context/target_info.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -694,19 +694,17 @@ impl<'cfg> RustcTargetData<'cfg> {
694694
} else {
695695
config.host_cfg_triple(&rustc.host)?
696696
};
697+
let is_cross = !requested_kinds.iter().any(CompileKind::is_host);
697698

698699
// This is a hack. The unit_dependency graph builder "pretends" that
699700
// `CompileKind::Host` is `CompileKind::Target(host)` if the
700701
// `--target` flag is not specified. Since the unit_dependency code
701702
// needs access to the target config data, create a copy so that it
702703
// can be found. See `rebuild_unit_graph_shared` for why this is done.
703-
let is_cross = if requested_kinds.iter().any(CompileKind::is_host) {
704+
if !is_cross {
704705
let ct = CompileTarget::new(&rustc.host)?;
705706
target_info.insert(ct, host_info.clone());
706707
target_config.insert(ct, config.target_cfg_triple(&rustc.host)?);
707-
false
708-
} else {
709-
true
710708
};
711709

712710
let mut res = RustcTargetData {

0 commit comments

Comments
 (0)