Overhaul Constraint.

This commit changes it to store a `Region` instead of a `RegionVid` for the `Var` cases:
- We avoid having to call `Region::new_var` to re-create `Region`s from
  `RegionVid`s in a few places, avoiding the interning process, giving a
  small perf win. (At the cost of the type allowing some invalid
  combinations of values.)
- All the cases now store two `Region`s, so the commit also separates
  the `ConstraintKind` (a new type) from the `sub` and `sup` arguments
  in `Constraint`.
This commit is contained in:
Nicholas Nethercote
2025-07-25 20:34:36 +10:00
parent 75a1f47750
commit 066a973312
11 changed files with 225 additions and 239 deletions

View File

@@ -205,7 +205,6 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate<
let region_assumptions = self.0.inner.borrow().region_assumptions().to_owned();
let region_constraints = self.0.with_region_constraints(|region_constraints| {
make_query_region_constraints(
self.tcx,
region_obligations,
region_constraints,
region_assumptions,