Skip to content

Commit 9822b57

Browse files
committed
Auto merge of #49891 - cuviper:compiletest-crash, r=alexcrichton
compiletest: detect non-ICE compiler panics Fixes #49888, but will be blocked by revealing #49889.
2 parents 8a09bc6 + fedee13 commit 9822b57

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/librustc/ty/sty.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -876,8 +876,10 @@ impl<'a, 'gcx, 'tcx> ParamTy {
876876
}
877877

878878
pub fn is_self(&self) -> bool {
879-
if self.name == keywords::SelfType.name().as_str() {
880-
assert_eq!(self.idx, 0);
879+
// FIXME(#50125): Ignoring `Self` with `idx != 0` might lead to weird behavior elsewhere,
880+
// but this should only be possible when using `-Z continue-parse-after-error` like
881+
// `compile-fail/issue-36638.rs`.
882+
if self.name == keywords::SelfType.name().as_str() && self.idx == 0 {
881883
true
882884
} else {
883885
false

src/test/compile-fail/borrowck/two-phase-reservation-sharing-interference.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// ignore-tidy-linelength
1212

13-
// revisions: nll_beyond nll_target
13+
// revisions: nll_target
1414

1515
// The following revisions are disabled due to missing support from two-phase beyond autorefs
1616
//[nll_beyond]compile-flags: -Z borrowck=mir -Z two-phase-borrows -Z two-phase-beyond-autoref

src/tools/compiletest/src/runtest.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1168,6 +1168,8 @@ impl<'test> TestCx<'test> {
11681168
for line in proc_res.stderr.lines() {
11691169
if line.contains("error: internal compiler error") {
11701170
self.fatal_proc_rec("compiler encountered internal error", proc_res);
1171+
} else if line.contains(" panicked at ") {
1172+
self.fatal_proc_rec("compiler panicked", proc_res);
11711173
}
11721174
}
11731175
}

0 commit comments

Comments
 (0)