Skip to content

Commit

Permalink
Fix more ReEmpty ICEs
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewjasper committed Oct 24, 2019
1 parent 89e645a commit d724174
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
Expand Up @@ -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);
Expand All @@ -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);
}
Expand Down
18 changes: 18 additions & 0 deletions src/test/ui/nll/empty-type-predicate-2.rs
@@ -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() {}
4 changes: 2 additions & 2 deletions src/test/ui/nll/empty-type-predicate.rs
Expand Up @@ -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(); }

0 comments on commit d724174

Please sign in to comment.