Skip to content

Commit c69bd94

Browse files
committed
make applied_member_constraints accept an SCC instead of a region
1 parent 8b76518 commit c69bd94

File tree

1 file changed

+7
-6
lines changed
  • compiler/rustc_borrowck/src/region_infer

1 file changed

+7
-6
lines changed

compiler/rustc_borrowck/src/region_infer/mod.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -644,11 +644,12 @@ impl<'tcx> RegionInferenceContext<'tcx> {
644644
self.scc_universes[scc]
645645
}
646646

647-
/// Once region solving has completed, this function will return
648-
/// the member constraints that were applied to the value of a given
649-
/// region `r`. See `AppliedMemberConstraint`.
650-
pub(crate) fn applied_member_constraints(&self, r: RegionVid) -> &[AppliedMemberConstraint] {
651-
let scc = self.constraint_sccs.scc(r);
647+
/// Once region solving has completed, this function will return the member constraints that
648+
/// were applied to the value of a given SCC `scc`. See `AppliedMemberConstraint`.
649+
pub(crate) fn applied_member_constraints(
650+
&self,
651+
scc: ConstraintSccIndex,
652+
) -> &[AppliedMemberConstraint] {
652653
binary_search_util::binary_search_slice(
653654
&self.member_constraints_applied,
654655
|applied| applied.member_region_scc,
@@ -1945,7 +1946,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
19451946
// Member constraints can also give rise to `'r: 'x` edges that
19461947
// were not part of the graph initially, so watch out for those.
19471948
// (But they are extremely rare; this loop is very cold.)
1948-
for constraint in self.applied_member_constraints(r) {
1949+
for constraint in self.applied_member_constraints(self.constraint_sccs.scc(r)) {
19491950
let p_c = &self.member_constraints[constraint.member_constraint_index];
19501951
let constraint = OutlivesConstraint {
19511952
sup: r,

0 commit comments

Comments
 (0)