State what contains the laundered arena borrow in the flatten test

This commit is contained in:
Dennis Kobert
2026-09-07 16:11:32 +00:00
parent ef8312806d
commit e9a3199456

View File

@@ -881,7 +881,11 @@ mod tests {
let head = ctx.index_head();
let group = {
// SAFETY: the element is cloned out inside the scope, so no borrow
// into the frame escapes it.
// into the frame escapes it. The clone is shallow, so the `'static`
// the `GraphicSource` rows infer launders a borrow of `arena`: it is
// contained because `arena` outlives every use below and this test
// never resets it, so the interior stays resident for the whole
// generation the group is read in.
let scope = frames.scope();
let GPoll::Final(value) = record::serve_input(&wrapped, &ctx.promoted(&head, 0), &scope) else {
panic!("expected a final record");