Skip to content

Commit 7026faf

Browse files
Add snapshotting to ObligationForest
1 parent 05aeeb3 commit 7026faf

File tree

4 files changed

+790
-112
lines changed

4 files changed

+790
-112
lines changed

src/librustc_data_structures/obligation_forest/README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,9 @@ which includes three bits of information:
6060

6161
#### Snapshots
6262

63-
The `ObligationForest` supports a limited form of snapshots; see
64-
`start_snapshot`; `commit_snapshot`; and `rollback_snapshot`. In
65-
particular, you can use a snapshot to roll back new root
66-
obligations. However, it is an error to attempt to
67-
`process_obligations` during a snapshot.
63+
The `ObligationForest` supports snapshots; see
64+
`start_snapshot`; `commit_snapshot`; and `rollback_snapshot`. Snapshots roll
65+
back all externally visible state.
6866

6967
### Implementation details
7068

@@ -74,7 +72,8 @@ the forest is stored in a vector. Each element of the vector is a node
7472
in some tree. Each node in the vector has the index of an (optional)
7573
parent and (for convenience) its root (which may be itself). It also
7674
has a current state, described by `NodeState`. After each
77-
processing step, we compress the vector to remove completed and error
78-
nodes, which aren't needed anymore.
75+
processing step, we compress the vector to remove completed and error nodes (or
76+
mark as 'popped' if we can't remove due to snapshotting), which aren't needed
77+
anymore.
7978

8079

0 commit comments

Comments
 (0)