Skip to content

Commit

Permalink
auto merge of #13967 : richo/rust/features/ICE-fails, r=alexcrichton
Browse files Browse the repository at this point in the history
This change makes internal compile errors in the compile-fail tests failures.

I believe this is the correct behaviour- those tests are intended to assert that the compiler doesn't proceed, not that it explodes.

So far, it fails on 4 tests in my environment, my testcase for #13943 which is what caused me to tackle this, and 3 others:

```
failures:
    [compile-fail] compile-fail/incompatible-tuple.rs # This one is mine and not on master
    [compile-fail] compile-fail/inherit-struct8.rs
    [compile-fail] compile-fail/issue-9725.rs
    [compile-fail] compile-fail/unsupported-cast.rs
```
  • Loading branch information
bors committed May 7, 2014
2 parents ef6daf9 + 201cd9e commit f83cf6c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/compiletest/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ fn run_cfail_test(config: &config, props: &TestProps, testfile: &Path) {
} else {
check_error_patterns(props, testfile, &proc_res);
}
check_no_compiler_crash(&proc_res);
}

fn run_rfail_test(config: &config, props: &TestProps, testfile: &Path) {
Expand Down Expand Up @@ -505,6 +506,15 @@ fn check_error_patterns(props: &TestProps,
}
}

fn check_no_compiler_crash(proc_res: &ProcRes) {
for line in proc_res.stderr.lines() {
if line.starts_with("error: internal compiler error:") {
fatal_ProcRes("compiler encountered internal error".to_owned(),
proc_res);
}
}
}

fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
testfile: &Path,
proc_res: &ProcRes) {
Expand Down
3 changes: 3 additions & 0 deletions src/test/compile-fail/inherit-struct8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// ignore-test FIXME: #13991


// Test struct inheritance.
#![feature(struct_inherit)]

Expand Down
2 changes: 2 additions & 0 deletions src/test/compile-fail/issue-9725.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// ignore-test FIXME: #13992

struct A { foo: int }

fn main() {
Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/unsupported-cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// ignore-test FIXME: #13993
// error-pattern:unsupported cast

extern crate libc;
Expand Down

0 comments on commit f83cf6c

Please sign in to comment.