Handle higher-ranked lifetime conflict errors where the subtype is the sup
region
These are happening since the switch to universes, and will now go through the "placeholder error" path, instead of the current fallback of E308 "mismatched types" errors.
This commit is contained in:
parent
c1437c944c
commit
a6028263d2
1 changed files with 24 additions and 0 deletions
|
@ -96,6 +96,30 @@ impl NiceRegionError<'me, 'gcx, 'tcx> {
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Some(RegionResolutionError::SubSupConflict(
|
||||||
|
vid,
|
||||||
|
_,
|
||||||
|
_,
|
||||||
|
_,
|
||||||
|
SubregionOrigin::Subtype(TypeTrace {
|
||||||
|
cause,
|
||||||
|
values: ValuePairs::TraitRefs(ExpectedFound { expected, found }),
|
||||||
|
}),
|
||||||
|
sup_placeholder @ ty::RePlaceholder(_),
|
||||||
|
))
|
||||||
|
if expected.def_id == found.def_id =>
|
||||||
|
{
|
||||||
|
Some(self.try_report_placeholders_trait(
|
||||||
|
Some(self.tcx().mk_region(ty::ReVar(*vid))),
|
||||||
|
cause,
|
||||||
|
None,
|
||||||
|
Some(*sup_placeholder),
|
||||||
|
expected.def_id,
|
||||||
|
expected.substs,
|
||||||
|
found.substs,
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
Some(RegionResolutionError::ConcreteFailure(
|
Some(RegionResolutionError::ConcreteFailure(
|
||||||
SubregionOrigin::Subtype(TypeTrace {
|
SubregionOrigin::Subtype(TypeTrace {
|
||||||
cause,
|
cause,
|
||||||
|
|
Loading…
Reference in a new issue