Skip to content

Commit 3f9aea1

Browse files
committed
Clarify a comment in RegionConstraintCollector::leak_check.
1 parent 421bd77 commit 3f9aea1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/librustc/infer/region_constraints/leak_check.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ impl<'tcx> RegionConstraintCollector<'tcx> {
1414
/// retain the older (arguably incorrect) behavior of the
1515
/// compiler.
1616
///
17-
/// NB. The use of snapshot here is mostly an efficiency thing --
18-
/// we could search *all* region constraints, but that'd be a
19-
/// bigger set and the data structures are not setup for that. If
17+
/// NB. Although `_snapshot` isn't used, it's passed in to prove
18+
/// that we are in a snapshot, which guarantees that we can just
19+
/// search the "undo log" for edges. This is mostly an efficiency
20+
/// thing -- we could search *all* region constraints, but that'd be
21+
/// a bigger set and the data structures are not setup for that. If
2022
/// we wind up keeping some form of this check long term, it would
2123
/// probably be better to remove the snapshot parameter and to
2224
/// refactor the constraint set.

0 commit comments

Comments
 (0)