Skip to content

Commit eeed267

Browse files
authored
Rollup merge of rust-lang#96315 - SparrowLii:graph_lt, r=petrochenkov
Make the lifetime accurate which is used in the region constraints part This PR fixes the FIXME about lifetime using in the region constraints part. We cannot write `<'graph, 'tcx, D>` because the definition of `Successors<'0, '1, D>` requires `'1 : '0`. We cannot add bound to `'graph` either because `'graph` is required to be an arbitrary value in the definition of `WithSuccessors` So the most accurate way is to use `<'s, 'tcx, D>`. cc `@Aaron1011` who added this FIXME in rust-lang#85343
2 parents b100c02 + 343523c commit eeed267

File tree

1 file changed

+3
-6
lines changed
  • compiler/rustc_borrowck/src/constraints

1 file changed

+3
-6
lines changed

compiler/rustc_borrowck/src/constraints/graph.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ impl<'s, 'tcx, D: ConstraintGraphDirecton> RegionGraph<'s, 'tcx, D> {
190190

191191
/// Given a region `R`, iterate over all regions `R1` such that
192192
/// there exists a constraint `R: R1`.
193-
crate fn outgoing_regions(&self, region_sup: RegionVid) -> Successors<'_, 'tcx, D> {
193+
crate fn outgoing_regions(&self, region_sup: RegionVid) -> Successors<'s, 'tcx, D> {
194194
Successors {
195195
edges: self.constraint_graph.outgoing_edges(region_sup, self.set, self.static_region),
196196
}
@@ -225,10 +225,7 @@ impl<'s, 'tcx, D: ConstraintGraphDirecton> graph::WithSuccessors for RegionGraph
225225
}
226226
}
227227

228-
impl<'s, 'graph, 'tcx, D: ConstraintGraphDirecton> graph::GraphSuccessors<'graph>
229-
for RegionGraph<'s, 'tcx, D>
230-
{
228+
impl<'s, 'tcx, D: ConstraintGraphDirecton> graph::GraphSuccessors<'_> for RegionGraph<'s, 'tcx, D> {
231229
type Item = RegionVid;
232-
// FIXME - why can't this be `'graph, 'tcx`
233-
type Iter = Successors<'graph, 'graph, D>;
230+
type Iter = Successors<'s, 'tcx, D>;
234231
}

0 commit comments

Comments
 (0)