Auto merge of #49891 - cuviper:compiletest-crash, r=alexcrichton

compiletest: detect non-ICE compiler panics

Fixes #49888, but will be blocked by revealing #49889.
This commit is contained in:
bors 2018-04-27 07:43:46 +00:00
commit 9822b5709c
3 changed files with 7 additions and 3 deletions

View File

@ -876,8 +876,10 @@ impl<'a, 'gcx, 'tcx> ParamTy {
}
pub fn is_self(&self) -> bool {
if self.name == keywords::SelfType.name().as_str() {
assert_eq!(self.idx, 0);
// FIXME(#50125): Ignoring `Self` with `idx != 0` might lead to weird behavior elsewhere,
// but this should only be possible when using `-Z continue-parse-after-error` like
// `compile-fail/issue-36638.rs`.
if self.name == keywords::SelfType.name().as_str() && self.idx == 0 {
true
} else {
false

View File

@ -10,7 +10,7 @@
// ignore-tidy-linelength
// revisions: nll_beyond nll_target
// revisions: nll_target
// The following revisions are disabled due to missing support from two-phase beyond autorefs
//[nll_beyond]compile-flags: -Z borrowck=mir -Z two-phase-borrows -Z two-phase-beyond-autoref

View File

@ -1168,6 +1168,8 @@ impl<'test> TestCx<'test> {
for line in proc_res.stderr.lines() {
if line.contains("error: internal compiler error") {
self.fatal_proc_rec("compiler encountered internal error", proc_res);
} else if line.contains(" panicked at ") {
self.fatal_proc_rec("compiler panicked", proc_res);
}
}
}