File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -268,14 +268,14 @@ pub fn main() {
268
268
269
269
// Setting RUSTC_WRAPPER causes Cargo to pass 'rustc' as the first argument.
270
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 ( ) ) ;
271
+ let wrapper_mode = orig_args . get ( 1 ) . map ( Path :: new) . and_then ( Path :: file_stem ) == Some ( "rustc" . as_ref ( ) ) ;
272
272
273
273
if wrapper_mode {
274
274
// we still want to be able to invoke it normally though
275
275
orig_args. remove ( 1 ) ;
276
276
}
277
277
278
- if !wrapper_mode && std :: env :: args ( ) . any ( |a| a == "--help" || a == "-h" ) {
278
+ if !wrapper_mode && ( orig_args . iter ( ) . any ( |a| a == "--help" || a == "-h" ) || orig_args . len ( ) == 1 ) {
279
279
display_help ( ) ;
280
280
exit ( 0 ) ;
281
281
}
You can’t perform that action at this time.
0 commit comments