about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/librustc_driver/lib.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs
index 746f2db4767..d39dc8668c0 100644
--- a/src/librustc_driver/lib.rs
+++ b/src/librustc_driver/lib.rs
@@ -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 {