Skip to content

Commit

Permalink
Specify usability of inspect_typeck in comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinleroy committed Jan 19, 2024
1 parent 6352283 commit 2205c19
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 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 @@ -155,6 +155,8 @@ fn diagnostic_only_typeck<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &ty::T

/// Same as `typeck` but `inspect` is invoked on evaluation of each root obligation.
/// Inspecting obligations only works with the new trait solver.
/// This function is *only to be used* by external tools, it should not be
/// called from within rustc. Note, this is not a query, and thus is not cached.
pub fn inspect_typeck<'tcx>(
tcx: TyCtxt<'tcx>,
def_id: LocalDefId,
Expand Down
7 changes: 2 additions & 5 deletions compiler/rustc_trait_selection/src/solve/fulfill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ impl<'tcx> TraitEngine<'tcx> for FulfillmentCtxt<'tcx> {
}

fn collect_remaining_errors(&mut self, infcx: &InferCtxt<'tcx>) -> Vec<FulfillmentError<'tcx>> {
let errors = self
.obligations
self.obligations
.drain(..)
.map(|obligation| {
let code = infcx.probe(|_| {
Expand Down Expand Up @@ -102,9 +101,7 @@ impl<'tcx> TraitEngine<'tcx> for FulfillmentCtxt<'tcx> {
root_obligation: obligation,
}
})
.collect();

errors
.collect()
}

fn select_where_possible(&mut self, infcx: &InferCtxt<'tcx>) -> Vec<FulfillmentError<'tcx>> {
Expand Down

0 comments on commit 2205c19

Please sign in to comment.