Skip to content

Commit

Permalink
Remove unstable flag
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinleroy committed Jan 18, 2024
1 parent 47d53cd commit 6352283
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 37 deletions.
2 changes: 2 additions & 0 deletions compiler/rustc_hir_typeck/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ fn diagnostic_only_typeck<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &ty::T
typeck_with_fallback(tcx, def_id, fallback, None)
}

/// Same as `typeck` but `inspect` is invoked on evaluation of each root obligation.
/// Inspecting obligations only works with the new trait solver.
pub fn inspect_typeck<'tcx>(
tcx: TyCtxt<'tcx>,
def_id: LocalDefId,
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_infer/src/infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1730,6 +1730,7 @@ impl<'tcx> InferCtxt<'tcx> {
}
}

/// Attach a callback to be invoked on each root obligation evaluated in the new trait solver.
pub fn attach_obligation_inspector(&self, inspector: ObligationInspector<'tcx>) {
debug_assert!(
self.obligation_inspector.get().is_none(),
Expand Down
3 changes: 0 additions & 3 deletions compiler/rustc_session/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1914,9 +1914,6 @@ written to standard error output)"),
"for every macro invocation, print its name and arguments (default: no)"),
track_diagnostics: bool = (false, parse_bool, [UNTRACKED],
"tracks where in rustc a diagnostic was emitted"),
track_trait_obligations: bool = (false, parse_bool, [TRACKED],
"tracks evaluated obligations while trait solving, option is only \
valid when -Z next-solver=globally (default: no)"),
// Diagnostics are considered side-effects of a query (see `QuerySideEffects`) and are saved
// alongside query results and changes to translation options can affect diagnostics - so
// translation options should be tracked.
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_trait_selection/src/solve/fulfill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl<'tcx> FulfillmentCtxt<'tcx> {
FulfillmentCtxt { obligations: Vec::new(), usable_in_snapshot: infcx.num_open_snapshots() }
}

fn track_evaluated_obligation(
fn inspect_evaluated_obligation(
&self,
infcx: &InferCtxt<'tcx>,
obligation: &PredicateObligation<'tcx>,
Expand Down Expand Up @@ -119,7 +119,7 @@ impl<'tcx> TraitEngine<'tcx> for FulfillmentCtxt<'tcx> {
for obligation in mem::take(&mut self.obligations) {
let goal = obligation.clone().into();
let result = infcx.evaluate_root_goal(goal, GenerateProofTree::IfEnabled).0;
self.track_evaluated_obligation(infcx, &obligation, &result);
self.inspect_evaluated_obligation(infcx, &obligation, &result);
let (changed, certainty, nested_goals) = match result {
Ok(result) => result,
Err(NoSolution) => {
Expand Down
32 changes: 0 additions & 32 deletions tests/ui/traits/track_trait_obligations.rs

This file was deleted.

0 comments on commit 6352283

Please sign in to comment.