Skip to content

Commit 254fc50

Browse files
committed
fmt
1 parent c4c7463 commit 254fc50

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

cargo-miri/bin.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#![feature(inner_deref)]
22

33
use std::env;
4+
use std::ffi::OsString;
45
use std::fs::{self, File};
56
use std::io::{self, BufRead, Write};
67
use std::ops::Not;
78
use std::path::{Path, PathBuf};
89
use std::process::Command;
9-
use std::ffi::OsString;
1010

1111
use rustc_version::VersionMeta;
1212

@@ -265,7 +265,8 @@ fn setup(subcommand: MiriCommand) {
265265
let sysroot = std::str::from_utf8(&sysroot).unwrap();
266266
let sysroot = Path::new(sysroot.trim_end_matches('\n'));
267267
// Check for `$SYSROOT/lib/rustlib/src/rust/src`; test if that contains `libstd/lib.rs`.
268-
let rustup_src = sysroot.join("lib").join("rustlib").join("src").join("rust").join("src");
268+
let rustup_src =
269+
sysroot.join("lib").join("rustlib").join("src").join("rust").join("src");
269270
if !rustup_src.join("libstd").join("lib.rs").exists() {
270271
// Ask the user to install the `rust-src` component, and use that.
271272
let mut cmd = Command::new("rustup");
@@ -363,8 +364,7 @@ path = "lib.rs"
363364
let sysroot = if target == &host { dir.join("HOST") } else { PathBuf::from(dir) };
364365
std::env::set_var("MIRI_SYSROOT", &sysroot); // pass the env var to the processes we spawn, which will turn it into "--sysroot" flags
365366
// Figure out what to print.
366-
let print_sysroot = subcommand == MiriCommand::Setup
367-
&& has_arg_flag("--print-sysroot"); // whether we just print the sysroot path
367+
let print_sysroot = subcommand == MiriCommand::Setup && has_arg_flag("--print-sysroot"); // whether we just print the sysroot path
368368
if print_sysroot {
369369
// Print just the sysroot and nothing else; this way we do not need any escaping.
370370
println!("{}", sysroot.display());
@@ -564,6 +564,8 @@ fn main() {
564564
// dependencies get dispatched to `rustc`, the final test/binary to `miri`.
565565
inside_cargo_rustc();
566566
} else {
567-
show_error(format!("`cargo-miri` must be called with either `miri` or `rustc` as first argument."))
567+
show_error(format!(
568+
"`cargo-miri` must be called with either `miri` or `rustc` as first argument."
569+
))
568570
}
569571
}

0 commit comments

Comments
 (0)