rustc_middle::ty::search_graph

Trait Cx

source
pub trait Cx: Copy {
    type Input: Debug + Eq + Hash + Copy;
    type Result: Debug + Eq + Hash + Copy;
    type DepNodeIndex;
    type Tracked<T: Debug + Clone>: Debug;

    // Required methods
    fn mk_tracked<T>(
        self,
        data: T,
        dep_node_index: Self::DepNodeIndex,
    ) -> Self::Tracked<T>
       where T: Debug + Clone;
    fn get_tracked<T>(self, tracked: &Self::Tracked<T>) -> T
       where T: Debug + Clone;
    fn with_cached_task<T>(
        self,
        task: impl FnOnce() -> T,
    ) -> (T, Self::DepNodeIndex);
    fn with_global_cache<R>(
        self,
        mode: SolverMode,
        f: impl FnOnce(&mut GlobalCache<Self>) -> R,
    ) -> R;
    fn evaluation_is_concurrent(&self) -> bool;
}
Expand description

The search graph does not simply use Interner directly to enable its fuzzing without having to stub the rest of the interner. We don’t make this a super trait of Interner as users of the shared type library shouldn’t have to care about Input and Result as they are implementation details of the search graph.

Required Associated Types§

Required Methods§

source

fn mk_tracked<T>( self, data: T, dep_node_index: Self::DepNodeIndex, ) -> Self::Tracked<T>
where T: Debug + Clone,

source

fn get_tracked<T>(self, tracked: &Self::Tracked<T>) -> T
where T: Debug + Clone,

source

fn with_cached_task<T>( self, task: impl FnOnce() -> T, ) -> (T, Self::DepNodeIndex)

source

fn with_global_cache<R>( self, mode: SolverMode, f: impl FnOnce(&mut GlobalCache<Self>) -> R, ) -> R

source

fn evaluation_is_concurrent(&self) -> bool

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.

Implementors§