Skip to content

Commit de972f1

Browse files
committed
Remove obsolete error and unused var
`build-std` now works with no `--target` specified to either use defaulted target or host target.
1 parent b6c2c47 commit de972f1

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

src/cargo/ops/cargo_compile.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,7 @@ pub fn create_bcx<'a, 'cfg>(
404404
.shell()
405405
.warn("-Zbuild-std does not currently fully support --build-plan")?;
406406
}
407-
if build_config.requested_kinds[0].is_host() {
408-
// TODO: This should eventually be fixed. Unfortunately it is not
409-
// easy to get the host triple in BuildConfig. Consider changing
410-
// requested_target to an enum, or some other approach.
411-
anyhow::bail!("-Zbuild-std requires --target");
412-
}
407+
413408
let (std_package_set, std_resolve, std_features) =
414409
standard_lib::resolve_std(ws, &target_data, &build_config.requested_kinds, crates)?;
415410
pkg_set.add_set(std_package_set);
@@ -476,14 +471,6 @@ pub fn create_bcx<'a, 'cfg>(
476471
// assuming `--target $HOST` was specified. See
477472
// `rebuild_unit_graph_shared` for more on why this is done.
478473
let explicit_host_kind = CompileKind::Target(CompileTarget::new(&target_data.rustc.host)?);
479-
let explicit_host_kinds: Vec<_> = build_config
480-
.requested_kinds
481-
.iter()
482-
.map(|kind| match kind {
483-
CompileKind::Host => explicit_host_kind,
484-
CompileKind::Target(t) => CompileKind::Target(*t),
485-
})
486-
.collect();
487474

488475
// Passing `build_config.requested_kinds` instead of
489476
// `explicit_host_kinds` here so that `generate_targets` can do

0 commit comments

Comments
 (0)