From b4db387a6c886d4242a94d997c48967abd63314c Mon Sep 17 00:00:00 2001 From: Ariel Ben-Yehuda Date: Sat, 15 Dec 2018 01:22:41 +0200 Subject: [PATCH] address review comments --- src/librustc/infer/canonical/query_response.rs | 4 +--- src/librustc_typeck/check/method/probe.rs | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/librustc/infer/canonical/query_response.rs b/src/librustc/infer/canonical/query_response.rs index e225b12366fb..ebfc20e30f74 100644 --- a/src/librustc/infer/canonical/query_response.rs +++ b/src/librustc/infer/canonical/query_response.rs @@ -125,9 +125,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> { /// include all region obligations, so this includes all cases /// that care about regions) with this function, you have to /// do it yourself, by e.g. having them be a part of the answer. - /// - /// TDFX(nikomatsakis): not sure this is the best name. - pub fn make_query_response_with_obligations_pending( + pub fn make_query_response_ignoring_pending_obligations( &self, inference_vars: CanonicalVarValues<'tcx>, answer: T diff --git a/src/librustc_typeck/check/method/probe.rs b/src/librustc_typeck/check/method/probe.rs index 573253c2e1b4..190419048b4b 100644 --- a/src/librustc_typeck/check/method/probe.rs +++ b/src/librustc_typeck/check/method/probe.rs @@ -276,7 +276,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { param_env_and_self_ty, self_ty); MethodAutoderefStepsResult { steps: Lrc::new(vec![CandidateStep { - self_ty: self.make_query_response_with_obligations_pending( + self_ty: self.make_query_response_ignoring_pending_obligations( canonical_inference_vars, self_ty), autoderefs: 0, from_unsafe_deref: false, @@ -387,7 +387,7 @@ fn method_autoderef_steps<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'gcx>, let mut steps: Vec<_> = autoderef.by_ref() .map(|(ty, d)| { let step = CandidateStep { - self_ty: infcx.make_query_response_with_obligations_pending( + self_ty: infcx.make_query_response_ignoring_pending_obligations( inference_vars.clone(), ty), autoderefs: d, from_unsafe_deref: reached_raw_pointer, @@ -407,7 +407,7 @@ fn method_autoderef_steps<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'gcx>, ty::Error => { Some(MethodAutoderefBadTy { reached_raw_pointer, - ty: infcx.make_query_response_with_obligations_pending( + ty: infcx.make_query_response_ignoring_pending_obligations( inference_vars, final_ty) }) } @@ -415,7 +415,7 @@ fn method_autoderef_steps<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'gcx>, let dereferences = steps.len() - 1; steps.push(CandidateStep { - self_ty: infcx.make_query_response_with_obligations_pending( + self_ty: infcx.make_query_response_ignoring_pending_obligations( inference_vars, infcx.tcx.mk_slice(elem_ty)), autoderefs: dereferences, // this could be from an unsafe deref if we had