Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't try to lower ReEmpty in NLL
  • Loading branch information
matthewjasper committed Jun 3, 2019
1 parent c57ed9d commit 2751b86
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Expand Up @@ -334,6 +334,13 @@ impl UniversalRegionRelationsBuilder<'cx, 'gcx, 'tcx> {

match outlives_bound {
OutlivesBound::RegionSubRegion(r1, r2) => {
// `where Type:` is lowered to `where Type: 'empty` so that
// we check `Type` is well formed, but there's no use for
// this bound here.
if let ty::ReEmpty = r1 {
return;
}

// The bound says that `r1 <= r2`; we store `r2: r1`.
let r1 = self.universal_regions.to_region_vid(r1);
let r2 = self.universal_regions.to_region_vid(r2);
Expand Down
11 changes: 11 additions & 0 deletions src/test/ui/nll/empty-type-predicate.rs
@@ -0,0 +1,11 @@
// Regression test for #61315
//
// `dyn T:` is lowered to `dyn T: ReEmpty` - check that we don't ICE in NLL for
// the unexpected region.

// compile-pass

trait T {}
fn f() where dyn T: {}

fn main() {}

0 comments on commit 2751b86

Please sign in to comment.