Skip to content

Commit

Permalink
SearchGraphDelegate: use PhantomData + comment
Browse files Browse the repository at this point in the history
  • Loading branch information
lcnr committed Jul 12, 2024
1 parent d2c6922 commit 809acd2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions compiler/rustc_next_trait_solver/src/solve/search_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ use rustc_type_ir::inherent::Predicate;
use rustc_type_ir::search_graph::{self, CycleKind, UsageKind};
use rustc_type_ir::solve::{CanonicalInput, Certainty, QueryResult};
use rustc_type_ir::Interner;
use std::marker::PhantomData;

use super::inspect;
use super::{inspect::ProofTreeBuilder, FIXPOINT_STEP_LIMIT};

/// This type is never constructed. We only use it to implement `search_graph::Delegate`
/// for all types which impl `SolverDelegate` and doing it directly fails in coherence.
pub(super) struct SearchGraphDelegate<D: SolverDelegate> {
_marker: PhantomData<D>,
}
pub(super) type SearchGraph<D> = search_graph::SearchGraph<SearchGraphDelegate<D>>;

pub(super) struct SearchGraphDelegate<D: SolverDelegate>(D);
impl<D, I> search_graph::Delegate for SearchGraphDelegate<D>
where
D: SolverDelegate<Interner = I>,
Expand Down

0 comments on commit 809acd2

Please sign in to comment.