Skip to content

Commit 216818d

Browse files
committed
analyse comments
1 parent 6e4e6b9 commit 216818d

File tree

1 file changed

+6
-7
lines changed
  • compiler/rustc_trait_selection/src/solve/inspect

1 file changed

+6
-7
lines changed

compiler/rustc_trait_selection/src/solve/inspect/analyse.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ impl<'a, 'tcx> InspectCandidate<'a, 'tcx> {
5454
self.result.map(|c| c.value.certainty)
5555
}
5656

57+
/// Visit all nested goals of this candidate without rolling
58+
/// back their inference constraints. This function modifies
59+
/// the state of the `infcx`.
5760
pub fn visit_nested_no_probe<V: ProofTreeVisitor<'tcx>>(&self, visitor: &mut V) -> V::Result {
5861
if self.goal.depth < visitor.config().max_depth {
5962
let infcx = self.goal.infcx;
@@ -129,13 +132,9 @@ impl<'a, 'tcx> InspectCandidate<'a, 'tcx> {
129132
V::Result::output()
130133
}
131134

132-
/// Visit the nested goals of this candidate.
133-
///
134-
/// FIXME(@lcnr): we have to slightly adapt this API
135-
/// to also use it to compute the most relevant goal
136-
/// for fulfillment errors. Will do that once we actually
137-
/// need it.
138-
pub fn visit_nested<V: ProofTreeVisitor<'tcx>>(&self, visitor: &mut V) -> V::Result {
135+
/// Visit all nested goals of this candidate, rolling back
136+
/// all inference constraints.
137+
pub fn visit_nested_in_probe<V: ProofTreeVisitor<'tcx>>(&self, visitor: &mut V) -> V::Result {
139138
self.goal.infcx.probe(|_| self.visit_nested_no_probe(visitor))
140139
}
141140
}

0 commit comments

Comments
 (0)