Skip to content

Commit b4f76b3

Browse files
authored
Rollup merge of #146182 - ChayimFriedman2:ns-probe, r=jackh726
Don't require next-solver `ProbeRef` to be `Copy` rust-analyzer would like to use a non-interned `Probe` there. Also rename it to `Probe` for this reason. We can make it `Copy` (although then `Probe` will need to be `Clone` for rust-analyzer) but it seems just non-needed. r? types
2 parents fbaf7ff + 5d13845 commit b4f76b3

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

compiler/rustc_middle/src/ty/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -738,8 +738,8 @@ impl<'tcx> Interner for TyCtxt<'tcx> {
738738
)
739739
}
740740

741-
type ProbeRef = &'tcx inspect::Probe<TyCtxt<'tcx>>;
742-
fn mk_probe_ref(self, probe: inspect::Probe<Self>) -> &'tcx inspect::Probe<TyCtxt<'tcx>> {
741+
type Probe = &'tcx inspect::Probe<TyCtxt<'tcx>>;
742+
fn mk_probe(self, probe: inspect::Probe<Self>) -> &'tcx inspect::Probe<TyCtxt<'tcx>> {
743743
self.arena.alloc(probe)
744744
}
745745
fn evaluate_root_goal_for_proof_tree_raw(

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,7 +1275,7 @@ pub fn evaluate_root_goal_for_proof_tree_raw_provider<
12751275
>(
12761276
cx: I,
12771277
canonical_goal: CanonicalInput<I>,
1278-
) -> (QueryResult<I>, I::ProbeRef) {
1278+
) -> (QueryResult<I>, I::Probe) {
12791279
let mut inspect = inspect::ProofTreeBuilder::new();
12801280
let canonical_result = SearchGraph::<D>::evaluate_root_goal_for_proof_tree(
12811281
cx,
@@ -1284,7 +1284,7 @@ pub fn evaluate_root_goal_for_proof_tree_raw_provider<
12841284
&mut inspect,
12851285
);
12861286
let final_revision = inspect.unwrap();
1287-
(canonical_result, cx.mk_probe_ref(final_revision))
1287+
(canonical_result, cx.mk_probe(final_revision))
12881288
}
12891289

12901290
/// Evaluate a goal to build a proof tree.

compiler/rustc_type_ir/src/interner.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use std::borrow::Borrow;
12
use std::fmt::Debug;
23
use std::hash::Hash;
34
use std::ops::Deref;
@@ -383,12 +384,12 @@ pub trait Interner:
383384
defining_anchor: Self::LocalDefId,
384385
) -> Self::LocalDefIds;
385386

386-
type ProbeRef: Copy + Debug + Hash + Eq + Deref<Target = inspect::Probe<Self>>;
387-
fn mk_probe_ref(self, probe: inspect::Probe<Self>) -> Self::ProbeRef;
387+
type Probe: Debug + Hash + Eq + Borrow<inspect::Probe<Self>>;
388+
fn mk_probe(self, probe: inspect::Probe<Self>) -> Self::Probe;
388389
fn evaluate_root_goal_for_proof_tree_raw(
389390
self,
390391
canonical_goal: CanonicalInput<Self>,
391-
) -> (QueryResult<Self>, Self::ProbeRef);
392+
) -> (QueryResult<Self>, Self::Probe);
392393
}
393394

394395
/// Imagine you have a function `F: FnOnce(&[T]) -> R`, plus an iterator `iter`

compiler/rustc_type_ir/src/solve/inspect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub type CanonicalState<I, T> = Canonical<I, State<I, T>>;
4949
pub struct GoalEvaluation<I: Interner> {
5050
pub uncanonicalized_goal: Goal<I, I::Predicate>,
5151
pub orig_values: Vec<I::GenericArg>,
52-
pub final_revision: I::ProbeRef,
52+
pub final_revision: I::Probe,
5353
pub result: QueryResult<I>,
5454
}
5555

0 commit comments

Comments
 (0)