From 63f654a495ed868bcd5fb0ee03e1ff581e08e9ee Mon Sep 17 00:00:00 2001 From: Alex Butler Date: Tue, 13 Mar 2018 21:03:22 +0000 Subject: [PATCH] fix #48816 don't print help on indirect compiler ICE --- src/librustc_driver/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) 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, 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 { -- 2.44.0