1
Fork 0

Auto merge of #95474 - oli-obk:tait_ub, r=jackh726

Neither require nor imply lifetime bounds on opaque type for well formedness

The actual hidden type can live arbitrarily longer than any individual lifetime and arbitrarily shorter than all but one of the lifetimes.

fixes #86218
fixes #84305

This is a **breaking change** but it is a necessary soundness fix
This commit is contained in:
bors 2022-09-25 19:15:26 +00:00
commit f5193a9fcc
34 changed files with 696 additions and 153 deletions

View file

@ -156,6 +156,9 @@ fn implied_bounds_from_components<'tcx>(
Component::Region(r) => Some(OutlivesBound::RegionSubRegion(sub_region, r)),
Component::Param(p) => Some(OutlivesBound::RegionSubParam(sub_region, p)),
Component::Projection(p) => Some(OutlivesBound::RegionSubProjection(sub_region, p)),
Component::Opaque(def_id, substs) => {
Some(OutlivesBound::RegionSubOpaque(sub_region, def_id, substs))
}
Component::EscapingProjection(_) =>
// If the projection has escaping regions, don't
// try to infer any implied bounds even for its