Rollup merge of #65775 - matthewjasper:reempty, r=pnkfelix

Fix more `ReEmpty` ICEs

closes #65553

r? @pnkfelix
This commit is contained in:
Mazdak Farrokhzad 2019-10-25 06:18:14 +02:00 committed by GitHub
commit 100c924527
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 2 deletions

View File

@ -178,6 +178,9 @@ impl<'a, 'b, 'tcx> TypeOutlivesDelegate<'tcx> for &'a mut ConstraintConversion<'
a: ty::Region<'tcx>,
b: ty::Region<'tcx>,
) {
if let ty::ReEmpty = a {
return;
}
let b = self.to_region_vid(b);
let a = self.to_region_vid(a);
self.add_outlives(b, a);
@ -190,6 +193,9 @@ impl<'a, 'b, 'tcx> TypeOutlivesDelegate<'tcx> for &'a mut ConstraintConversion<'
a: ty::Region<'tcx>,
bound: VerifyBound<'tcx>,
) {
if let ty::ReEmpty = a {
return;
}
let type_test = self.verify_to_type_test(kind, a, bound);
self.add_type_test(type_test);
}

View File

@ -0,0 +1,18 @@
// Regression test for #65553
//
// `D::Error:` is lowered to `D::Error: ReEmpty` - check that we don't ICE in
// NLL for the unexpected region.
// check-pass
trait Deserializer {
type Error;
}
fn d1<D: Deserializer>() where D::Error: {}
fn d2<D: Deserializer>() {
d1::<D>();
}
fn main() {}

View File

@ -3,9 +3,9 @@
// `dyn T:` is lowered to `dyn T: ReEmpty` - check that we don't ICE in NLL for
// the unexpected region.
// build-pass (FIXME(62277): could be check-pass?)
// check-pass
trait T {}
fn f() where dyn T: {}
fn main() {}
fn main() { f(); }