Rollup merge of #65775 - matthewjasper:reempty, r=pnkfelix
Fix more `ReEmpty` ICEs closes #65553 r? @pnkfelix
This commit is contained in:
commit
100c924527
@ -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);
|
||||
}
|
||||
|
18
src/test/ui/nll/empty-type-predicate-2.rs
Normal file
18
src/test/ui/nll/empty-type-predicate-2.rs
Normal 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() {}
|
@ -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(); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user