Skip to content

Commit

Permalink
Auto merge of #49891 - cuviper:compiletest-crash, r=alexcrichton
Browse files Browse the repository at this point in the history
compiletest: detect non-ICE compiler panics

Fixes #49888, but will be blocked by revealing #49889.
  • Loading branch information
bors committed Apr 27, 2018
2 parents 8a09bc6 + fedee13 commit 9822b57
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/librustc/ty/sty.rs
Expand Up @@ -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
Expand Down
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/tools/compiletest/src/runtest.rs
Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit 9822b57

Please sign in to comment.