mach: always call ensure_bootstrapped before call_rustup_run

This commit is contained in:
Simon Sapin 2020-01-02 14:48:13 +01:00
parent e96bcea669
commit 6f70a9c1de
2 changed files with 2 additions and 1 deletions

View file

@ -360,7 +360,7 @@ class CommandBase(object):
def call_rustup_run(self, args, **kwargs):
if self.config["tools"]["use-rustup"]:
self.ensure_rustup_version()
assert self.context.bootstrapped
args = ["rustup" + BIN_SUFFIX, "run", "--install", self.rust_toolchain()] + args
else:
args[0] += BIN_SUFFIX

View file

@ -310,6 +310,7 @@ class MachCommands(CommandBase):
return 0
def install_rustfmt(self):
self.ensure_bootstrapped()
with open(os.devnull, "w") as devnull:
if self.call_rustup_run(["cargo", "fmt", "--version", "-q"],
stderr=devnull) != 0: