Skip to content

Commit da18aab

Browse files
committed
separate is_cross from target insert operations
1 parent ba8b1ad commit da18aab

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
@@ -837,19 +837,17 @@ impl<'cfg> RustcTargetData<'cfg> {
837837
} else {
838838
config.host_cfg_triple(&rustc.host)?
839839
};
840+
let is_cross = !requested_kinds.iter().any(CompileKind::is_host);
840841

841842
// This is a hack. The unit_dependency graph builder "pretends" that
842843
// `CompileKind::Host` is `CompileKind::Target(host)` if the
843844
// `--target` flag is not specified. Since the unit_dependency code
844845
// needs access to the target config data, create a copy so that it
845846
// can be found. See `rebuild_unit_graph_shared` for why this is done.
846-
let is_cross = if requested_kinds.iter().any(CompileKind::is_host) {
847+
if !is_cross {
847848
let ct = CompileTarget::new(&rustc.host)?;
848849
target_info.insert(ct, host_info.clone());
849850
target_config.insert(ct, config.target_cfg_triple(&rustc.host)?);
850-
false
851-
} else {
852-
true
853851
};
854852

855853
let mut res = RustcTargetData {

0 commit comments

Comments
 (0)