Skip to content

Commit 63f654a

Browse files
committed
fix #48816 don't print help on indirect compiler ICE
1 parent 8c4ff22 commit 63f654a

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
@@ -1457,6 +1457,12 @@ fn extra_compiler_flags() -> Option<(Vec<String>, bool)> {
14571457
args.push(arg.to_string_lossy().to_string());
14581458
}
14591459

1460+
// Avoid printing help because of empty args. This can suggest the compiler
1461+
// itself is not the program root (consider RLS).
1462+
if args.len() < 2 {
1463+
return None;
1464+
}
1465+
14601466
let matches = if let Some(matches) = handle_options(&args) {
14611467
matches
14621468
} else {

0 commit comments

Comments
 (0)