Skip to content

Commit 2205c19

Browse files
committed
Specify usability of inspect_typeck in comment.
1 parent 6352283 commit 2205c19

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

compiler/rustc_hir_typeck/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ fn diagnostic_only_typeck<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &ty::T
155155

156156
/// Same as `typeck` but `inspect` is invoked on evaluation of each root obligation.
157157
/// Inspecting obligations only works with the new trait solver.
158+
/// This function is *only to be used* by external tools, it should not be
159+
/// called from within rustc. Note, this is not a query, and thus is not cached.
158160
pub fn inspect_typeck<'tcx>(
159161
tcx: TyCtxt<'tcx>,
160162
def_id: LocalDefId,

compiler/rustc_trait_selection/src/solve/fulfill.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ impl<'tcx> TraitEngine<'tcx> for FulfillmentCtxt<'tcx> {
7272
}
7373

7474
fn collect_remaining_errors(&mut self, infcx: &InferCtxt<'tcx>) -> Vec<FulfillmentError<'tcx>> {
75-
let errors = self
76-
.obligations
75+
self.obligations
7776
.drain(..)
7877
.map(|obligation| {
7978
let code = infcx.probe(|_| {
@@ -102,9 +101,7 @@ impl<'tcx> TraitEngine<'tcx> for FulfillmentCtxt<'tcx> {
102101
root_obligation: obligation,
103102
}
104103
})
105-
.collect();
106-
107-
errors
104+
.collect()
108105
}
109106

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

0 commit comments

Comments
 (0)