Rollup merge of #103641 - compiler-errors:issue-103624, r=cjgillot
Don't carry MIR location in `ConstraintCategory::CallArgument`
It turns out that `ConstraintCategory::CallArgument` cannot just carry a MIR location in it, since we may bubble them up to totally different MIR bodies.
So instead, revert the commit a6b5f95fb0
, and instead just erase regions from the original `Option<Ty<'tcx>>` that it carried, so that it doesn't ICE with the changes in #103220.
Best reviewed in parts -- the first is just a revert, and the second is where the meaningful changes happen.
Fixes #103624
This commit is contained in:
commit
84663cee39
24 changed files with 165 additions and 100 deletions
|
@ -632,7 +632,7 @@ impl<'tcx> InferCtxt<'tcx> {
|
|||
/// creates query region constraints.
|
||||
pub fn make_query_region_constraints<'tcx>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
outlives_obligations: impl Iterator<Item = (Ty<'tcx>, ty::Region<'tcx>, ConstraintCategory)>,
|
||||
outlives_obligations: impl Iterator<Item = (Ty<'tcx>, ty::Region<'tcx>, ConstraintCategory<'tcx>)>,
|
||||
region_constraints: &RegionConstraintData<'tcx>,
|
||||
) -> QueryRegionConstraints<'tcx> {
|
||||
let RegionConstraintData { constraints, verifys, givens, member_constraints } =
|
||||
|
|
|
@ -425,7 +425,7 @@ pub enum SubregionOrigin<'tcx> {
|
|||
static_assert_size!(SubregionOrigin<'_>, 32);
|
||||
|
||||
impl<'tcx> SubregionOrigin<'tcx> {
|
||||
pub fn to_constraint_category(&self) -> ConstraintCategory {
|
||||
pub fn to_constraint_category(&self) -> ConstraintCategory<'tcx> {
|
||||
match self {
|
||||
Self::Subtype(type_trace) => type_trace.cause.to_constraint_category(),
|
||||
Self::AscribeUserTypeProvePredicate(span) => ConstraintCategory::Predicate(*span),
|
||||
|
|
|
@ -210,7 +210,7 @@ pub trait TypeOutlivesDelegate<'tcx> {
|
|||
origin: SubregionOrigin<'tcx>,
|
||||
a: ty::Region<'tcx>,
|
||||
b: ty::Region<'tcx>,
|
||||
constraint_category: ConstraintCategory,
|
||||
constraint_category: ConstraintCategory<'tcx>,
|
||||
);
|
||||
|
||||
fn push_verify(
|
||||
|
@ -259,7 +259,7 @@ where
|
|||
origin: infer::SubregionOrigin<'tcx>,
|
||||
ty: Ty<'tcx>,
|
||||
region: ty::Region<'tcx>,
|
||||
category: ConstraintCategory,
|
||||
category: ConstraintCategory<'tcx>,
|
||||
) {
|
||||
assert!(!ty.has_escaping_bound_vars());
|
||||
|
||||
|
@ -273,7 +273,7 @@ where
|
|||
origin: infer::SubregionOrigin<'tcx>,
|
||||
components: &[Component<'tcx>],
|
||||
region: ty::Region<'tcx>,
|
||||
category: ConstraintCategory,
|
||||
category: ConstraintCategory<'tcx>,
|
||||
) {
|
||||
for component in components.iter() {
|
||||
let origin = origin.clone();
|
||||
|
@ -529,7 +529,7 @@ impl<'cx, 'tcx> TypeOutlivesDelegate<'tcx> for &'cx InferCtxt<'tcx> {
|
|||
origin: SubregionOrigin<'tcx>,
|
||||
a: ty::Region<'tcx>,
|
||||
b: ty::Region<'tcx>,
|
||||
_constraint_category: ConstraintCategory,
|
||||
_constraint_category: ConstraintCategory<'tcx>,
|
||||
) {
|
||||
self.sub_regions(origin, a, b)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue