Skip to content

Commit 9a3bfbc

Browse files
Make proof tree building generic
1 parent fb9d1d0 commit 9a3bfbc

File tree

5 files changed

+111
-93
lines changed

5 files changed

+111
-93
lines changed

Cargo.lock

+2
Original file line numberDiff line numberDiff line change
@@ -4759,6 +4759,7 @@ name = "rustc_trait_selection"
47594759
version = "0.0.0"
47604760
dependencies = [
47614761
"bitflags 2.5.0",
4762+
"derivative",
47624763
"itertools 0.12.1",
47634764
"rustc_ast",
47644765
"rustc_ast_ir",
@@ -4778,6 +4779,7 @@ dependencies = [
47784779
"rustc_span",
47794780
"rustc_target",
47804781
"rustc_transmute",
4782+
"rustc_type_ir",
47814783
"smallvec",
47824784
"tracing",
47834785
]

compiler/rustc_trait_selection/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ edition = "2021"
66
[dependencies]
77
# tidy-alphabetical-start
88
bitflags = "2.4.1"
9+
derivative = "2.2.0"
910
itertools = "0.12"
1011
rustc_ast = { path = "../rustc_ast" }
1112
rustc_ast_ir = { path = "../rustc_ast_ir" }
@@ -25,6 +26,7 @@ rustc_session = { path = "../rustc_session" }
2526
rustc_span = { path = "../rustc_span" }
2627
rustc_target = { path = "../rustc_target" }
2728
rustc_transmute = { path = "../rustc_transmute", features = ["rustc"] }
29+
rustc_type_ir = { path = "../rustc_type_ir" }
2830
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
2931
tracing = "0.1"
3032
# tidy-alphabetical-end

compiler/rustc_trait_selection/src/solve/eval_ctxt/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ pub struct EvalCtxt<'a, 'tcx> {
9595
// evaluation code.
9696
tainted: Result<(), NoSolution>,
9797

98-
pub(super) inspect: ProofTreeBuilder<'tcx>,
98+
pub(super) inspect: ProofTreeBuilder<TyCtxt<'tcx>>,
9999
}
100100

101101
#[derive(PartialEq, Eq, Debug, Hash, HashStable, Clone, Copy)]
@@ -194,7 +194,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
194194
tcx: TyCtxt<'tcx>,
195195
search_graph: &'a mut search_graph::SearchGraph<'tcx>,
196196
canonical_input: CanonicalInput<'tcx>,
197-
canonical_goal_evaluation: &mut ProofTreeBuilder<'tcx>,
197+
canonical_goal_evaluation: &mut ProofTreeBuilder<TyCtxt<'tcx>>,
198198
f: impl FnOnce(&mut EvalCtxt<'_, 'tcx>, Goal<'tcx, ty::Predicate<'tcx>>) -> R,
199199
) -> R {
200200
let intercrate = match search_graph.solver_mode() {
@@ -256,7 +256,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
256256
tcx: TyCtxt<'tcx>,
257257
search_graph: &'a mut search_graph::SearchGraph<'tcx>,
258258
canonical_input: CanonicalInput<'tcx>,
259-
goal_evaluation: &mut ProofTreeBuilder<'tcx>,
259+
goal_evaluation: &mut ProofTreeBuilder<TyCtxt<'tcx>>,
260260
) -> QueryResult<'tcx> {
261261
let mut canonical_goal_evaluation =
262262
goal_evaluation.new_canonical_goal_evaluation(canonical_input);

0 commit comments

Comments
 (0)