@@ -58,10 +58,10 @@ impl CrateRunInfo {
58
58
59
59
fn store ( & self , filename : & Path ) {
60
60
let file = File :: create ( filename)
61
- . unwrap_or_else ( |_| show_error ( format ! ( "Cannot create `{}`" , filename. display( ) ) ) ) ;
61
+ . unwrap_or_else ( |_| show_error ( format ! ( "cannot create `{}`" , filename. display( ) ) ) ) ;
62
62
let file = BufWriter :: new ( file) ;
63
63
serde_json:: ser:: to_writer ( file, self )
64
- . unwrap_or_else ( |_| show_error ( format ! ( "Cannot write to `{}`" , filename. display( ) ) ) ) ;
64
+ . unwrap_or_else ( |_| show_error ( format ! ( "cannot write to `{}`" , filename. display( ) ) ) ) ;
65
65
}
66
66
}
67
67
@@ -204,15 +204,15 @@ fn ask_to_run(mut cmd: Command, ask: bool, text: &str) {
204
204
match buf. trim ( ) . to_lowercase ( ) . as_ref ( ) {
205
205
// Proceed.
206
206
"" | "y" | "yes" => { }
207
- "n" | "no" => show_error ( format ! ( "Aborting as per your request" ) ) ,
208
- a => show_error ( format ! ( "I do not understand `{}`" , a) ) ,
207
+ "n" | "no" => show_error ( format ! ( "aborting as per your request" ) ) ,
208
+ a => show_error ( format ! ( "invalid answer `{}`" , a) ) ,
209
209
} ;
210
210
} else {
211
211
println ! ( "Running `{:?}` to {}." , cmd, text) ;
212
212
}
213
213
214
214
if cmd. status ( ) . expect ( & format ! ( "failed to execute {:?}" , cmd) ) . success ( ) . not ( ) {
215
- show_error ( format ! ( "Failed to {}" , text) ) ;
215
+ show_error ( format ! ( "failed to {}" , text) ) ;
216
216
}
217
217
}
218
218
@@ -235,7 +235,7 @@ fn setup(subcommand: MiriCommand) {
235
235
if xargo_version ( ) . map_or ( true , |v| v < XARGO_MIN_VERSION ) {
236
236
if std:: env:: var_os ( "XARGO_CHECK" ) . is_some ( ) {
237
237
// The user manually gave us a xargo binary; don't do anything automatically.
238
- show_error ( format ! ( "Your xargo is too old; please upgrade to the latest version" ) )
238
+ show_error ( format ! ( "xargo is too old; please upgrade to the latest version" ) )
239
239
}
240
240
let mut cmd = cargo ( ) ;
241
241
cmd. args ( & [ "install" , "xargo" , "-f" ] ) ;
@@ -275,7 +275,7 @@ fn setup(subcommand: MiriCommand) {
275
275
}
276
276
} ;
277
277
if !rust_src. exists ( ) {
278
- show_error ( format ! ( "Given Rust source directory `{}` does not exist." , rust_src. display( ) ) ) ;
278
+ show_error ( format ! ( "given Rust source directory `{}` does not exist." , rust_src. display( ) ) ) ;
279
279
}
280
280
281
281
// Next, we need our own libstd. Prepare a xargo project for that purpose.
@@ -349,7 +349,7 @@ path = "lib.rs"
349
349
command. env_remove ( "RUSTFLAGS" ) ;
350
350
// Finally run it!
351
351
if command. status ( ) . expect ( "failed to run xargo" ) . success ( ) . not ( ) {
352
- show_error ( format ! ( "Failed to run xargo" ) ) ;
352
+ show_error ( format ! ( "failed to run xargo" ) ) ;
353
353
}
354
354
355
355
// That should be it! But we need to figure out where xargo built stuff.
@@ -575,7 +575,7 @@ fn phase_cargo_rustc(args: env::Args) {
575
575
576
576
// Use our custom sysroot.
577
577
let sysroot =
578
- env:: var_os ( "MIRI_SYSROOT" ) . expect ( "The wrapper should have set MIRI_SYSROOT" ) ;
578
+ env:: var_os ( "MIRI_SYSROOT" ) . expect ( "the wrapper should have set MIRI_SYSROOT" ) ;
579
579
cmd. arg ( "--sysroot" ) ;
580
580
cmd. arg ( sysroot) ;
581
581
} else {
@@ -597,20 +597,20 @@ fn phase_cargo_rustc(args: env::Args) {
597
597
if emit_link_hack {
598
598
// Some platforms prepend "lib", some do not... let's just create both files.
599
599
let filename = out_filename ( "lib" , ".rlib" ) ;
600
- File :: create ( filename) . expect ( "Failed to create rlib file" ) ;
600
+ File :: create ( filename) . expect ( "failed to create rlib file" ) ;
601
601
let filename = out_filename ( "" , ".rlib" ) ;
602
- File :: create ( filename) . expect ( "Failed to create rlib file" ) ;
602
+ File :: create ( filename) . expect ( "failed to create rlib file" ) ;
603
603
}
604
604
}
605
605
606
606
fn phase_cargo_runner ( binary : & Path , binary_args : env:: Args ) {
607
607
let verbose = std:: env:: var_os ( "MIRI_VERBOSE" ) . is_some ( ) ;
608
608
609
609
let file = File :: open ( & binary)
610
- . unwrap_or_else ( |_| show_error ( format ! ( "File {:?} not found or `cargo-miri` invoked incorrectly; please only invoke this binary through `cargo miri`" , binary) ) ) ;
610
+ . unwrap_or_else ( |_| show_error ( format ! ( "file {:?} not found or `cargo-miri` invoked incorrectly; please only invoke this binary through `cargo miri`" , binary) ) ) ;
611
611
let file = BufReader :: new ( file) ;
612
612
let info: CrateRunInfo = serde_json:: from_reader ( file)
613
- . unwrap_or_else ( |_| show_error ( format ! ( "File {:?} does not contain valid JSON" , binary) ) ) ;
613
+ . unwrap_or_else ( |_| show_error ( format ! ( "file {:?} contains outdated or invalid JSON; try `cargo clean` " , binary) ) ) ;
614
614
615
615
// Set missing env vars. Looks like `build.rs` vars are still set at run-time, but
616
616
// `CARGO_BIN_EXE_*` are not. This means we can give the run-time environment precedence,
@@ -654,7 +654,7 @@ fn phase_cargo_runner(binary: &Path, binary_args: env::Args) {
654
654
}
655
655
// Set sysroot.
656
656
let sysroot =
657
- env:: var_os ( "MIRI_SYSROOT" ) . expect ( "The wrapper should have set MIRI_SYSROOT" ) ;
657
+ env:: var_os ( "MIRI_SYSROOT" ) . expect ( "the wrapper should have set MIRI_SYSROOT" ) ;
658
658
cmd. arg ( "--sysroot" ) ;
659
659
cmd. arg ( sysroot) ;
660
660
// Respect `MIRIFLAGS`.
0 commit comments