pub(crate) trait QueryDispatcherUnerased<'tcx> {
type UnerasedValue;
type Dispatcher: QueryDispatcher<'tcx, Qcx = QueryCtxt<'tcx>>;
const NAME: &'static &'static str;
// Required methods
fn query_dispatcher(tcx: TyCtxt<'tcx>) -> Self::Dispatcher;
fn restore_val(
value: <Self::Dispatcher as QueryDispatcher<'tcx>>::Value,
) -> Self::UnerasedValue;
}Expand description
Provides access to vtable-like operations for a query
(by creating a QueryDispatcher),
but also keeps track of the “unerased” value type of the query
(i.e. the actual result type in the query declaration).
This trait allows some per-query code to be defined in generic functions with a trait bound, instead of having to be defined inline within a macro expansion.
There is one macro-generated implementation of this trait for each query,
on the type rustc_query_impl::query_impl::$name::QueryType.
Required Associated Constants§
Required Associated Types§
type UnerasedValue
type Dispatcher: QueryDispatcher<'tcx, Qcx = QueryCtxt<'tcx>>
Required Methods§
fn query_dispatcher(tcx: TyCtxt<'tcx>) -> Self::Dispatcher
fn restore_val( value: <Self::Dispatcher as QueryDispatcher<'tcx>>::Value, ) -> Self::UnerasedValue
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.