From cc48ae5a64a4e648211a2e7c9f37df0c5d6c32a6 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 11 Apr 2018 15:41:22 -0700 Subject: [PATCH 1/3] compiletest: detect non-ICE compiler panics --- src/tools/compiletest/src/runtest.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index aabf2e6f8f0e6..4a7f902a89207 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -1166,6 +1166,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); } } } From a42db7dbfd6ffdcc0c60246d688dc09376c2a1ef Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 20 Apr 2018 11:37:41 -0700 Subject: [PATCH 2/3] Add a stopgap for #49889 --- src/librustc/ty/sty.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/librustc/ty/sty.rs b/src/librustc/ty/sty.rs index 310fcbcfcb374..320191167bebf 100644 --- a/src/librustc/ty/sty.rs +++ b/src/librustc/ty/sty.rs @@ -885,8 +885,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 From fedee138343eebbe1f7d52d4d3587f8ce5929c9c Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 24 Apr 2018 16:17:31 -0700 Subject: [PATCH 3/3] Disable two-phase-reservation-sharing-interference[nll_beyond] A comment already stated that this test should be disabled, but its `should_fail` is not enough to excuse it from a compiler panic. Remove it from the `revisions` list to disable it harder. --- .../borrowck/two-phase-reservation-sharing-interference.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 1333167b780a8..1e86603c19e8d 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