]> git.lizzy.rs Git - rust.git/commitdiff
fix #48816 don't print help on indirect compiler ICE
authorAlex Butler <alexheretic@gmail.com>
Tue, 13 Mar 2018 21:03:22 +0000 (21:03 +0000)
committerAlex Butler <alexheretic@gmail.com>
Tue, 13 Mar 2018 22:26:29 +0000 (22:26 +0000)
src/librustc_driver/lib.rs

index 746f2db4767f92842ea4372284a350ca39ab944e..d39dc8668c0e792c69adc07afcc3026730d494c3 100644 (file)
@@ -1457,6 +1457,12 @@ fn extra_compiler_flags() -> Option<(Vec<String>, bool)> {
         args.push(arg.to_string_lossy().to_string());
     }
 
+    // Avoid printing help because of empty args. This can suggest the compiler
+    // itself is not the program root (consider RLS).
+    if args.len() < 2 {
+        return None;
+    }
+
     let matches = if let Some(matches) = handle_options(&args) {
         matches
     } else {