We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 320b94d + 227dc44 commit 0574d66Copy full SHA for 0574d66
src/driver.rs
@@ -268,14 +268,14 @@ pub fn main() {
268
269
// Setting RUSTC_WRAPPER causes Cargo to pass 'rustc' as the first argument.
270
// We're invoking the compiler programmatically, so we ignore this/
271
- let wrapper_mode = Path::new(&orig_args[1]).file_stem() == Some("rustc".as_ref());
+ let wrapper_mode = orig_args.get(1).map(Path::new).and_then(Path::file_stem) == Some("rustc".as_ref());
272
273
if wrapper_mode {
274
// we still want to be able to invoke it normally though
275
orig_args.remove(1);
276
}
277
278
- if !wrapper_mode && std::env::args().any(|a| a == "--help" || a == "-h") {
+ if !wrapper_mode && (orig_args.iter().any(|a| a == "--help" || a == "-h") || orig_args.len() == 1) {
279
display_help();
280
exit(0);
281
0 commit comments