Skip to content

Commit 17904c1

Browse files
committed
Always honour --no-update-default-toolchain
There was a corner case when no toolchain was installed and rustup was reinstalled where this was ignored.
1 parent b5f98c8 commit 17904c1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/cli/self_update.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,9 @@ fn _install_selection<'a>(
782782
}
783783
writeln!(process().stdout())?;
784784
None
785-
} else if user_specified_something || cfg.find_default()?.is_none() {
785+
} else if user_specified_something
786+
|| (update_existing_toolchain && cfg.find_default()?.is_none())
787+
{
786788
Some(match toolchain_opt {
787789
Some(s) => cfg.get_toolchain(s, false)?,
788790
None => match cfg.find_default()? {
@@ -1104,7 +1106,7 @@ mod test {
11041106
None, // No toolchain specified
11051107
"default", // default profile
11061108
None,
1107-
false,
1109+
true,
11081110
&[],
11091111
&[],
11101112
)

0 commit comments

Comments
 (0)