diff --git a/src/bin/rustfmt.rs b/src/bin/rustfmt.rs index 789f8773345..d5b34d98b2d 100644 --- a/src/bin/rustfmt.rs +++ b/src/bin/rustfmt.rs @@ -164,7 +164,7 @@ fn main() { fn print_usage(opts: &Options, reason: &str) { let reason = format!("{}\nusage: {} [options] ...", reason, - env::current_exe().unwrap().display()); + env::args_os().next().unwrap().to_string_lossy()); println!("{}", opts.usage(&reason)); }