diff options
| author | Alex Butler <alexheretic@gmail.com> | 2018-03-13 21:03:22 +0000 |
|---|---|---|
| committer | Alex Butler <alexheretic@gmail.com> | 2018-03-13 22:26:29 +0000 |
| commit | 63f654a495ed868bcd5fb0ee03e1ff581e08e9ee (patch) | |
| tree | e3e88c420f74b3237cf48dcd43e41784f2ed8bf5 /src | |
| parent | 8c4ff22a2d745097197c659ef9e3b04b8ceeb070 (diff) | |
| download | rust-63f654a495ed868bcd5fb0ee03e1ff581e08e9ee.tar.gz rust-63f654a495ed868bcd5fb0ee03e1ff581e08e9ee.zip | |
fix #48816 don't print help on indirect compiler ICE
Diffstat (limited to 'src')
| -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 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 { |
