rust/hg-cpython/src/dagops.rs
changeset 51252 24d3298189d7
parent 51238 578c049f0408
--- a/rust/hg-cpython/src/dagops.rs	Sun Oct 29 12:18:03 2023 +0100
+++ b/rust/hg-cpython/src/dagops.rs	Thu Nov 23 03:41:58 2023 +0100
@@ -28,6 +28,7 @@
     revs: PyObject,
 ) -> PyResult<HashSet<PyRevision>> {
     let py_leaked = py_rust_index_to_graph(py, index)?;
+    // Safety: we don't leak the "faked" reference out of `UnsafePyLeaked`
     let index = &*unsafe { py_leaked.try_borrow(py)? };
     let mut as_set: HashSet<Revision> = rev_pyiter_collect(py, &revs, index)?;
     dagops::retain_heads(index, &mut as_set)