Add some comments to QueryArenas

This commit is contained in:
Zalathar
2026-01-21 18:10:53 +11:00
parent 91a0e09d3e
commit 2495e5834b
+10 -4
View File
@@ -342,12 +342,18 @@ pub fn provided_to_erased<'tcx>(
})*
}
/// Holds per-query arenas for queries with the `arena_cache` modifier.
#[derive(Default)]
pub struct QueryArenas<'tcx> {
$($(#[$attr])* pub $name: query_if_arena!([$($modifiers)*]
(TypedArena<<$V as $crate::query::arena_cached::ArenaCached<'tcx>>::Allocated>)
()
),)*
$(
$(#[$attr])*
pub $name: query_if_arena!([$($modifiers)*]
// Use the `ArenaCached` helper trait to determine the arena's value type.
(TypedArena<<$V as $crate::query::arena_cached::ArenaCached<'tcx>>::Allocated>)
// No arena for this query, so the field type is `()`.
()
),
)*
}
#[derive(Default)]