about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-04-27 07:43:46 +0000
committerbors <bors@rust-lang.org>2018-04-27 07:43:46 +0000
commit9822b5709ca78d6398e9ae609de0181116e8b0db (patch)
tree4a4afa106692d6ab5bf4ebeae00b4a3cc27eb233
parent8a09bc6a77a908b11120cb09e6d2bf0b7a13494e (diff)
parentfedee138343eebbe1f7d52d4d3587f8ce5929c9c (diff)
downloadrust-9822b5709ca78d6398e9ae609de0181116e8b0db.tar.gz
rust-9822b5709ca78d6398e9ae609de0181116e8b0db.zip
Auto merge of #49891 - cuviper:compiletest-crash, r=alexcrichton
compiletest: detect non-ICE compiler panics

Fixes #49888, but will be blocked by revealing #49889.
-rw-r--r--src/librustc/ty/sty.rs6
-rw-r--r--src/test/compile-fail/borrowck/two-phase-reservation-sharing-interference.rs2
-rw-r--r--src/tools/compiletest/src/runtest.rs2
3 files changed, 7 insertions, 3 deletions
diff --git a/src/librustc/ty/sty.rs b/src/librustc/ty/sty.rs
index 0dfae13cc75..59a1ca0e078 100644
--- a/src/librustc/ty/sty.rs
+++ b/src/librustc/ty/sty.rs
@@ -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
diff --git a/src/test/compile-fail/borrowck/two-phase-reservation-sharing-interference.rs b/src/test/compile-fail/borrowck/two-phase-reservation-sharing-interference.rs
index 1333167b780..1e86603c19e 100644
--- a/src/test/compile-fail/borrowck/two-phase-reservation-sharing-interference.rs
+++ b/src/test/compile-fail/borrowck/two-phase-reservation-sharing-interference.rs
@@ -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
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 85434bb8a69..d1dac370c9e 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -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);
             }
         }
     }