Skip to content

Commit 508ffa3

Browse files
committed
Rollup merge of #48993 - alexheretic:fix-48816, r=michaelwoerister
fix #48816 don't print help on indirect compiler ICE #48816 (comment)
2 parents 6639b60 + 63f654a commit 508ffa3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/librustc_driver/lib.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1484,6 +1484,12 @@ fn extra_compiler_flags() -> Option<(Vec<String>, bool)> {
14841484
args.push(arg.to_string_lossy().to_string());
14851485
}
14861486

1487+
// Avoid printing help because of empty args. This can suggest the compiler
1488+
// itself is not the program root (consider RLS).
1489+
if args.len() < 2 {
1490+
return None;
1491+
}
1492+
14871493
let matches = if let Some(matches) = handle_options(&args) {
14881494
matches
14891495
} else {

0 commit comments

Comments
 (0)