From 2495e5834bd166fc5b2fab99f3bcae7ca96fbcd8 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Wed, 21 Jan 2026 18:10:53 +1100 Subject: [PATCH] Add some comments to `QueryArenas` --- compiler/rustc_middle/src/query/plumbing.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_middle/src/query/plumbing.rs b/compiler/rustc_middle/src/query/plumbing.rs index be7a459d4bb1..16121c38d1a9 100644 --- a/compiler/rustc_middle/src/query/plumbing.rs +++ b/compiler/rustc_middle/src/query/plumbing.rs @@ -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)]