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() {
268268
269269 // Setting RUSTC_WRAPPER causes Cargo to pass 'rustc' as the first argument.
270270 // 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 ( ) ) ;
272272
273273 if wrapper_mode {
274274 // we still want to be able to invoke it normally though
275275 orig_args. remove ( 1 ) ;
276276 }
277277
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 ) {
279279 display_help ( ) ;
280280 exit ( 0 ) ;
281281 }
You can’t perform that action at this time.
0 commit comments