|
61 | 61 | //! results. This is used by the `FulfillmentContext` to decide when it
|
62 | 62 | //! has reached a steady state.
|
63 | 63 | //!
|
64 |
| -//! #### Snapshots |
65 |
| -//! |
66 |
| -//! The `ObligationForest` supports a limited form of snapshots; see |
67 |
| -//! `start_snapshot`, `commit_snapshot`, and `rollback_snapshot`. In |
68 |
| -//! particular, you can use a snapshot to roll back new root |
69 |
| -//! obligations. However, it is an error to attempt to |
70 |
| -//! `process_obligations` during a snapshot. |
71 |
| -//! |
72 | 64 | //! ### Implementation details
|
73 | 65 | //!
|
74 | 66 | //! For the most part, comments specific to the implementation are in the
|
@@ -151,10 +143,6 @@ pub struct ObligationForest<O: ForestObligation> {
|
151 | 143 | /// At the end of processing, those nodes will be removed by a
|
152 | 144 | /// call to `compress`.
|
153 | 145 | ///
|
154 |
| - /// At all times we maintain the invariant that every node appears |
155 |
| - /// at a higher index than its parent. This is needed by the |
156 |
| - /// backtrace iterator (which uses `split_at`). |
157 |
| - /// |
158 | 146 | /// Ideally, this would be an `IndexVec<NodeIndex, Node<O>>`. But that is
|
159 | 147 | /// slower, because this vector is accessed so often that the
|
160 | 148 | /// `u32`-to-`usize` conversions required for accesses are significant.
|
@@ -288,8 +276,6 @@ impl<O: ForestObligation> ObligationForest<O> {
|
288 | 276 | }
|
289 | 277 |
|
290 | 278 | /// Registers an obligation.
|
291 |
| - /// |
292 |
| - /// This CAN be done in a snapshot |
293 | 279 | pub fn register_obligation(&mut self, obligation: O) {
|
294 | 280 | // Ignore errors here - there is no guarantee of success.
|
295 | 281 | let _ = self.register_obligation_at(obligation, None);
|
@@ -355,8 +341,6 @@ impl<O: ForestObligation> ObligationForest<O> {
|
355 | 341 | }
|
356 | 342 |
|
357 | 343 | /// Converts all remaining obligations to the given error.
|
358 |
| - /// |
359 |
| - /// This cannot be done during a snapshot. |
360 | 344 | pub fn to_errors<E: Clone>(&mut self, error: E) -> Vec<Error<O, E>> {
|
361 | 345 | let mut errors = vec![];
|
362 | 346 | for i in 0..self.nodes.len() {
|
|
0 commit comments