diff options
| author | kennytm <kennytm@gmail.com> | 2018-03-14 23:29:57 +0800 |
|---|---|---|
| committer | kennytm <kennytm@gmail.com> | 2018-03-15 00:15:56 +0800 |
| commit | 508ffa3352e734d7dae0c167773cd9a02e2a22a5 (patch) | |
| tree | 1d6b0a612953bcdcefab66fae512a9c9f24e6a83 | |
| parent | 6639b60ec6f5479d2fac655e67d14d5a7a8adb27 (diff) | |
| parent | 63f654a495ed868bcd5fb0ee03e1ff581e08e9ee (diff) | |
| download | rust-508ffa3352e734d7dae0c167773cd9a02e2a22a5.tar.gz rust-508ffa3352e734d7dae0c167773cd9a02e2a22a5.zip | |
Rollup merge of #48993 - alexheretic:fix-48816, r=michaelwoerister
fix #48816 don't print help on indirect compiler ICE https://github.com/rust-lang/rust/issues/48816#issuecomment-372817573
| -rw-r--r-- | src/librustc_driver/lib.rs | 6 |
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 { |
