diff options
| author | Rémy Rakic <remy.rakic+github@gmail.com> | 2023-10-19 21:25:12 +0000 |
|---|---|---|
| committer | Rémy Rakic <remy.rakic+github@gmail.com> | 2023-10-19 21:25:12 +0000 |
| commit | c69bd9480abd4d26d7e2f5c877053878eec334a4 (patch) | |
| tree | 5d8cc893942509961ae6b9590ebff2e35159a9c8 | |
| parent | 8b76518a28e5e826c115fc06d8eebe51a59a58bd (diff) | |
| download | rust-c69bd9480abd4d26d7e2f5c877053878eec334a4.tar.gz rust-c69bd9480abd4d26d7e2f5c877053878eec334a4.zip | |
make `applied_member_constraints` accept an SCC instead of a region
| -rw-r--r-- | compiler/rustc_borrowck/src/region_infer/mod.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/compiler/rustc_borrowck/src/region_infer/mod.rs b/compiler/rustc_borrowck/src/region_infer/mod.rs index 96cbe98c216..e9c7d2918b9 100644 --- a/compiler/rustc_borrowck/src/region_infer/mod.rs +++ b/compiler/rustc_borrowck/src/region_infer/mod.rs @@ -644,11 +644,12 @@ impl<'tcx> RegionInferenceContext<'tcx> { self.scc_universes[scc] } - /// Once region solving has completed, this function will return - /// the member constraints that were applied to the value of a given - /// region `r`. See `AppliedMemberConstraint`. - pub(crate) fn applied_member_constraints(&self, r: RegionVid) -> &[AppliedMemberConstraint] { - let scc = self.constraint_sccs.scc(r); + /// Once region solving has completed, this function will return the member constraints that + /// were applied to the value of a given SCC `scc`. See `AppliedMemberConstraint`. + pub(crate) fn applied_member_constraints( + &self, + scc: ConstraintSccIndex, + ) -> &[AppliedMemberConstraint] { binary_search_util::binary_search_slice( &self.member_constraints_applied, |applied| applied.member_region_scc, @@ -1945,7 +1946,7 @@ impl<'tcx> RegionInferenceContext<'tcx> { // Member constraints can also give rise to `'r: 'x` edges that // were not part of the graph initially, so watch out for those. // (But they are extremely rare; this loop is very cold.) - for constraint in self.applied_member_constraints(r) { + for constraint in self.applied_member_constraints(self.constraint_sccs.scc(r)) { let p_c = &self.member_constraints[constraint.member_constraint_index]; let constraint = OutlivesConstraint { sup: r, |
