diff options
| author | Ralf Jung <post@ralfj.de> | 2024-03-24 14:49:46 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-03-24 14:49:46 +0100 |
| commit | acf3f52b7b8bdb40a3ab769c71f7b8c2eef99707 (patch) | |
| tree | d3fd12b686b0105865de33bd6d70b8e5c914bcba | |
| parent | fdb561309d34b5fd73f5233d73f8726c558b5755 (diff) | |
| download | rust-acf3f52b7b8bdb40a3ab769c71f7b8c2eef99707.tar.gz rust-acf3f52b7b8bdb40a3ab769c71f7b8c2eef99707.zip | |
miri-script/toolchain: make new_commit logic easier to follow
| -rw-r--r-- | src/tools/miri/miri-script/src/commands.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/miri/miri-script/src/commands.rs b/src/tools/miri/miri-script/src/commands.rs index cd127cd0322..66f323290b2 100644 --- a/src/tools/miri/miri-script/src/commands.rs +++ b/src/tools/miri/miri-script/src/commands.rs @@ -178,7 +178,7 @@ impl Command { .context("Please install rustup-toolchain-install-master by running 'cargo install rustup-toolchain-install-master'")?; let sh = Shell::new()?; sh.change_dir(miri_dir()?); - let new_commit = Some(sh.read_file("rust-version")?.trim().to_owned()); + let new_commit = sh.read_file("rust-version")?.trim().to_owned(); let current_commit = { let rustc_info = cmd!(sh, "rustc +miri --version -v").read(); if rustc_info.is_err() { @@ -193,7 +193,7 @@ impl Command { } }; // Check if we already are at that commit. - if current_commit == new_commit { + if current_commit.as_ref() == Some(&new_commit) { if active_toolchain()? != "miri" { cmd!(sh, "rustup override set miri").run()?; } @@ -202,7 +202,7 @@ impl Command { // Install and setup new toolchain. cmd!(sh, "rustup toolchain uninstall miri").run()?; - cmd!(sh, "rustup-toolchain-install-master -n miri -c cargo -c rust-src -c rustc-dev -c llvm-tools -c rustfmt -c clippy {flags...} -- {new_commit...}").run()?; + cmd!(sh, "rustup-toolchain-install-master -n miri -c cargo -c rust-src -c rustc-dev -c llvm-tools -c rustfmt -c clippy {flags...} -- {new_commit}").run()?; cmd!(sh, "rustup override set miri").run()?; // Cleanup. cmd!(sh, "cargo clean").run()?; |
