Skip to content

Commit 48b1a45

Browse files
committed
Fail on internal compiler errors in compile-fail
1 parent 0605f05 commit 48b1a45

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/compiletest/runtest.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ fn run_cfail_test(config: &config, props: &TestProps, testfile: &Path) {
8989
} else {
9090
check_error_patterns(props, testfile, &proc_res);
9191
}
92+
check_no_compiler_crash(&proc_res);
9293
}
9394

9495
fn run_rfail_test(config: &config, props: &TestProps, testfile: &Path) {
@@ -505,6 +506,15 @@ fn check_error_patterns(props: &TestProps,
505506
}
506507
}
507508

509+
fn check_no_compiler_crash(proc_res: &ProcRes) {
510+
for line in proc_res.stderr.lines() {
511+
if line.starts_with("error: internal compiler error:") {
512+
fatal_ProcRes("compiler encountered internal error".to_owned(),
513+
proc_res);
514+
}
515+
}
516+
}
517+
508518
fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
509519
testfile: &Path,
510520
proc_res: &ProcRes) {

0 commit comments

Comments
 (0)