Skip to content

Commit 6ee22e1

Browse files
Make proof tree building generic
1 parent 0f528a4 commit 6ee22e1

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(derivative::Derivative)]
@@ -225,7 +225,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
225225
tcx: TyCtxt<'tcx>,
226226
search_graph: &'a mut search_graph::SearchGraph<'tcx>,
227227
canonical_input: CanonicalInput<'tcx>,
228-
canonical_goal_evaluation: &mut ProofTreeBuilder<'tcx>,
228+
canonical_goal_evaluation: &mut ProofTreeBuilder<TyCtxt<'tcx>>,
229229
f: impl FnOnce(&mut EvalCtxt<'_, 'tcx>, Goal<'tcx, ty::Predicate<'tcx>>) -> R,
230230
) -> R {
231231
let intercrate = match search_graph.solver_mode() {
@@ -287,7 +287,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
287287
tcx: TyCtxt<'tcx>,
288288
search_graph: &'a mut search_graph::SearchGraph<'tcx>,
289289
canonical_input: CanonicalInput<'tcx>,
290-
goal_evaluation: &mut ProofTreeBuilder<'tcx>,
290+
goal_evaluation: &mut ProofTreeBuilder<TyCtxt<'tcx>>,
291291
) -> QueryResult<'tcx> {
292292
let mut canonical_goal_evaluation =
293293
goal_evaluation.new_canonical_goal_evaluation(canonical_input);

0 commit comments

Comments
 (0)