Don't try to lower ReEmpty in NLL
This commit is contained in:
parent
c57ed9d947
commit
2751b867a7
2 changed files with 18 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
11
src/test/ui/nll/empty-type-predicate.rs
Normal file
11
src/test/ui/nll/empty-type-predicate.rs
Normal file
|
|
@ -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() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue