Skip to content

Commit 5fcffb6

Browse files
committed
Remove another use of old_defining_use_anchor
1 parent 6ff727b commit 5fcffb6

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

compiler/rustc_infer/src/infer/canonical/query_response.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,14 @@ impl<'tcx> InferCtxt<'tcx> {
5757
inference_vars: CanonicalVarValues<'tcx>,
5858
answer: T,
5959
fulfill_cx: &mut dyn TraitEngine<'tcx>,
60+
defining_use_anchor: DefiningAnchor,
6061
) -> Fallible<CanonicalQueryResponse<'tcx, T>>
6162
where
6263
T: Debug + TypeFoldable<TyCtxt<'tcx>>,
6364
Canonical<'tcx, QueryResponse<'tcx, T>>: ArenaAllocatable<'tcx>,
6465
{
65-
let query_response = self.make_query_response(inference_vars, answer, fulfill_cx)?;
66+
let query_response =
67+
self.make_query_response(inference_vars, answer, fulfill_cx, defining_use_anchor)?;
6668
debug!("query_response = {:#?}", query_response);
6769
let canonical_result = self.canonicalize_response(query_response);
6870
debug!("canonical_result = {:#?}", canonical_result);
@@ -104,24 +106,25 @@ impl<'tcx> InferCtxt<'tcx> {
104106
inference_vars: CanonicalVarValues<'tcx>,
105107
answer: T,
106108
fulfill_cx: &mut dyn TraitEngine<'tcx>,
109+
defining_use_anchor: DefiningAnchor,
107110
) -> Result<QueryResponse<'tcx, T>, NoSolution>
108111
where
109112
T: Debug + TypeFoldable<TyCtxt<'tcx>>,
110113
{
111114
let tcx = self.tcx;
112115

113116
// Select everything, returning errors.
114-
let true_errors = fulfill_cx.select_where_possible(self, self.old_defining_use_anchor);
117+
let true_errors = fulfill_cx.select_where_possible(self, defining_use_anchor);
115118
debug!("true_errors = {:#?}", true_errors);
116119

117120
if !true_errors.is_empty() {
118121
// FIXME -- we don't indicate *why* we failed to solve
119-
debug!("make_query_response: true_errors={:#?}", true_errors);
122+
debug!("true_errors={:#?}", true_errors);
120123
return Err(NoSolution);
121124
}
122125

123126
// Anything left unselected *now* must be an ambiguity.
124-
let ambig_errors = fulfill_cx.select_all_or_error(self, self.old_defining_use_anchor);
127+
let ambig_errors = fulfill_cx.select_all_or_error(self, defining_use_anchor);
125128
debug!("ambig_errors = {:#?}", ambig_errors);
126129

127130
let region_obligations = self.take_registered_region_obligations();

compiler/rustc_trait_selection/src/traits/engine.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ impl<'a, 'tcx> ObligationCtxt<'a, 'tcx> {
248248
inference_vars,
249249
answer,
250250
&mut **self.engine.borrow_mut(),
251+
self.defining_use_anchor,
251252
)
252253
}
253254

0 commit comments

Comments
 (0)