Auto merge of #99806 - oli-obk:unconstrained_opaque_type, r=estebank

Allow patterns to constrain the hidden type of opaque types

fixes #96572

reverts a revert as original PR was a perf regression that was fixed by reverting it: https://github.com/rust-lang/rust/pull/99368#issuecomment-1186587864)

TODO:

* check if https://github.com/rust-lang/rust/issues/99685 is avoided
This commit is contained in:
bors 2022-09-20 12:09:52 +00:00
commit 4136b59b7d
40 changed files with 384 additions and 179 deletions

View file

@ -893,7 +893,7 @@ where
}
ty::Slice(ety) => self.open_drop_for_array(*ety, None),
_ => bug!("open drop from non-ADT `{:?}`", ty),
_ => span_bug!(self.source_info.span, "open drop from non-ADT `{:?}`", ty),
}
}

View file

@ -48,6 +48,7 @@ impl<'tcx> Lift for PlaceElem<'tcx> {
match *self {
ProjectionElem::Deref => ProjectionElem::Deref,
ProjectionElem::Field(f, ty) => ProjectionElem::Field(f, ty.lift()),
ProjectionElem::OpaqueCast(ty) => ProjectionElem::OpaqueCast(ty.lift()),
ProjectionElem::Index(ref i) => ProjectionElem::Index(i.lift()),
ProjectionElem::Subslice { from, to, from_end } => {
ProjectionElem::Subslice { from, to, from_end }