determine rust default language version independent of rust-toolchain.toml

This commit is contained in:
Anthony Sottile 2024-05-10 17:06:29 -04:00
parent 16023286d2
commit 296f59266e
2 changed files with 10 additions and 1 deletions

View file

@ -34,7 +34,7 @@ def get_default_version() -> str:
# Just detecting the executable does not suffice, because if rustup is
# installed but no toolchain is available, then `cargo` exists but
# cannot be used without installing a toolchain first.
if cmd_output_b('cargo', '--version', check=False)[0] == 0:
if cmd_output_b('cargo', '--version', check=False, cwd='/')[0] == 0:
return 'system'
else:
return C.DEFAULT