Skip to content

Commit

Permalink
Rollup merge of rust-lang#65775 - matthewjasper:reempty, r=pnkfelix
Browse files Browse the repository at this point in the history
Fix more `ReEmpty` ICEs

closes rust-lang#65553

r? @pnkfelix
  • Loading branch information
Centril authored Oct 25, 2019
2 parents 2b7cc64 + d724174 commit 100c924
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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 100c924

Please sign in to comment.