Skip to content

Commit 48aac03

Browse files
committed
resolve target triple before calling can_run
1 parent 59de864 commit 48aac03

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/cli/rustup_mode.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ use super::{
1717
self_update::{check_rustup_update, SelfUpdateMode},
1818
};
1919
use crate::cli::errors::CLIError;
20-
use crate::dist::dist::{
21-
PartialTargetTriple, PartialToolchainDesc, Profile, TargetTriple, ToolchainDesc,
22-
};
20+
use crate::dist::dist::{PartialTargetTriple, PartialToolchainDesc, Profile, TargetTriple};
2321
use crate::dist::manifest::Component;
2422
use crate::errors::RustupError;
2523
use crate::process;
@@ -959,8 +957,8 @@ fn update(cfg: &mut Cfg, m: &ArgMatches<'_>) -> Result<utils::ExitCode> {
959957

960958
if toolchain_has_triple {
961959
let host_arch = TargetTriple::from_host_or_build();
962-
if let Ok(toolchain_desc) = ToolchainDesc::from_str(name) {
963-
let target_triple = toolchain_desc.target;
960+
if let Ok(partial_toolchain_desc) = PartialToolchainDesc::from_str(name) {
961+
let target_triple = partial_toolchain_desc.resolve(&host_arch)?.target;
964962
if !forced && !host_arch.can_run(&target_triple)? {
965963
err!("DEPRECATED: future versions of rustup will require --force-non-host to install a non-host toolchain as the default.");
966964
warn!(

0 commit comments

Comments
 (0)