Skip to content

Commit 53effa4

Browse files
committed
eval_outlives: bail out early if both regions are in the same SCC
1 parent 2162e9d commit 53effa4

File tree

1 file changed

+5
-0
lines changed
  • compiler/rustc_borrowck/src/region_infer

1 file changed

+5
-0
lines changed

compiler/rustc_borrowck/src/region_infer/mod.rs

+5
Original file line numberDiff line numberDiff line change
@@ -1267,6 +1267,11 @@ impl<'tcx> RegionInferenceContext<'tcx> {
12671267
let sub_region_scc = self.constraint_sccs.scc(sub_region);
12681268
let sup_region_scc = self.constraint_sccs.scc(sup_region);
12691269

1270+
if sub_region_scc == sup_region_scc {
1271+
debug!("{sup_region:?}: {sub_region:?} holds trivially; they are in the same SCC");
1272+
return true;
1273+
}
1274+
12701275
// If we are checking that `'sup: 'sub`, and `'sub` contains
12711276
// some placeholder that `'sup` cannot name, then this is only
12721277
// true if `'sup` outlives static.

0 commit comments

Comments
 (0)