diff options
| author | Deadbeef <ent3rm4n@gmail.com> | 2025-08-09 13:00:15 +0800 |
|---|---|---|
| committer | Deadbeef <ent3rm4n@gmail.com> | 2025-08-09 22:24:44 +0800 |
| commit | 71f6e537faf861b30a4d863dc56c4ed6a1d4cf4b (patch) | |
| tree | c84eecdc13c69e59ba1d4c965f6645ccbf711118 /compiler/rustc_next_trait_solver/src | |
| parent | ca77504943887037504c7fc0b9bf06dab3910373 (diff) | |
| download | rust-71f6e537faf861b30a4d863dc56c4ed6a1d4cf4b.tar.gz rust-71f6e537faf861b30a4d863dc56c4ed6a1d4cf4b.zip | |
some `derive_more` refactors
some clauses can be merged together without requiring an attribute for each trait derived. also manually impl `Eq` because the `derive_where` generated code is too much for my comfort
Diffstat (limited to 'compiler/rustc_next_trait_solver/src')
| -rw-r--r-- | compiler/rustc_next_trait_solver/src/solve/inspect/build.rs | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/compiler/rustc_next_trait_solver/src/solve/inspect/build.rs b/compiler/rustc_next_trait_solver/src/solve/inspect/build.rs index c8521624ebb..fc56b006d94 100644 --- a/compiler/rustc_next_trait_solver/src/solve/inspect/build.rs +++ b/compiler/rustc_next_trait_solver/src/solve/inspect/build.rs @@ -68,7 +68,7 @@ impl<I: Interner> From<WipCanonicalGoalEvaluationStep<I>> for DebugSolver<I> { } } -#[derive_where(PartialEq, Eq, Debug; I: Interner)] +#[derive_where(PartialEq, Debug; I: Interner)] struct WipGoalEvaluation<I: Interner> { pub uncanonicalized_goal: Goal<I, I::Predicate>, pub orig_values: Vec<I::GenericArg>, @@ -78,6 +78,8 @@ struct WipGoalEvaluation<I: Interner> { pub result: Option<QueryResult<I>>, } +impl<I: Interner> Eq for WipGoalEvaluation<I> {} + impl<I: Interner> WipGoalEvaluation<I> { fn finalize(self) -> inspect::GoalEvaluation<I> { inspect::GoalEvaluation { @@ -98,7 +100,7 @@ impl<I: Interner> WipGoalEvaluation<I> { /// This only exists during proof tree building and does not have /// a corresponding struct in `inspect`. We need this to track a /// bunch of metadata about the current evaluation. -#[derive_where(PartialEq, Eq, Debug; I: Interner)] +#[derive_where(PartialEq, Debug; I: Interner)] struct WipCanonicalGoalEvaluationStep<I: Interner> { /// Unlike `EvalCtxt::var_values`, we append a new /// generic arg here whenever we create a new inference @@ -111,6 +113,8 @@ struct WipCanonicalGoalEvaluationStep<I: Interner> { evaluation: WipProbe<I>, } +impl<I: Interner> Eq for WipCanonicalGoalEvaluationStep<I> {} + impl<I: Interner> WipCanonicalGoalEvaluationStep<I> { fn current_evaluation_scope(&mut self) -> &mut WipProbe<I> { let mut current = &mut self.evaluation; @@ -132,7 +136,7 @@ impl<I: Interner> WipCanonicalGoalEvaluationStep<I> { } } -#[derive_where(PartialEq, Eq, Debug; I: Interner)] +#[derive_where(PartialEq, Debug; I: Interner)] struct WipProbe<I: Interner> { initial_num_var_values: usize, steps: Vec<WipProbeStep<I>>, @@ -140,6 +144,8 @@ struct WipProbe<I: Interner> { final_state: Option<inspect::CanonicalState<I, ()>>, } +impl<I: Interner> Eq for WipProbe<I> {} + impl<I: Interner> WipProbe<I> { fn finalize(self) -> inspect::Probe<I> { inspect::Probe { @@ -150,7 +156,7 @@ impl<I: Interner> WipProbe<I> { } } -#[derive_where(PartialEq, Eq, Debug; I: Interner)] +#[derive_where(PartialEq, Debug; I: Interner)] enum WipProbeStep<I: Interner> { AddGoal(GoalSource, inspect::CanonicalState<I, Goal<I, I::Predicate>>), NestedProbe(WipProbe<I>), @@ -158,6 +164,8 @@ enum WipProbeStep<I: Interner> { RecordImplArgs { impl_args: inspect::CanonicalState<I, I::GenericArgs> }, } +impl<I: Interner> Eq for WipProbeStep<I> {} + impl<I: Interner> WipProbeStep<I> { fn finalize(self) -> inspect::ProbeStep<I> { match self { |
