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