Skip to content

Commit eec9cb0

Browse files
committed
feat(config)!: remove implicit installation from resolve_toolchain()
1 parent 74db5d2 commit eec9cb0

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/config.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -713,13 +713,14 @@ impl<'a> Cfg<'a> {
713713
&self,
714714
name: Option<ResolvableToolchainName>,
715715
) -> Result<Toolchain<'_>> {
716-
Ok(match name {
716+
let toolchain = match name {
717717
Some(name) => {
718718
let desc = name.resolve(&self.get_default_host_triple()?)?;
719-
Toolchain::new(self, desc.into())?
719+
Some(desc.into())
720720
}
721-
None => self.find_or_install_active_toolchain(false).await?.0,
722-
})
721+
None => None,
722+
};
723+
self.local_toolchain(toolchain)
723724
}
724725

725726
pub(crate) fn resolve_local_toolchain(

tests/suite/cli_misc.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,6 +1099,10 @@ async fn which_asking_uninstalled_toolchain() {
10991099
#[tokio::test]
11001100
async fn override_by_toolchain_on_the_command_line() {
11011101
let mut cx = CliTestContext::new(Scenario::SimpleV2).await;
1102+
cx.config
1103+
.expect_ok(&["rustup", "toolchain", "install", "stable", "nightly"])
1104+
.await;
1105+
11021106
#[cfg(windows)]
11031107
cx.config
11041108
.expect_stdout_ok(

0 commit comments

Comments
 (0)