about summary refs log tree commit diff
diff options
context:
space:
mode:
-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 4974e6f24a8..5a1983bfec6 100644
--- a/src/librustc_driver/lib.rs
+++ b/src/librustc_driver/lib.rs
@@ -1484,6 +1484,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 {