Skip to content

Commit 88f7e57

Browse files
committed
tidy
1 parent 74c87c3 commit 88f7e57

File tree

1 file changed

+17
-9
lines changed
  • src/librustc_typeck/check/method

1 file changed

+17
-9
lines changed

src/librustc_typeck/check/method/probe.rs

+17-9
Original file line numberDiff line numberDiff line change
@@ -258,14 +258,15 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
258258
let param_env_and_self_ty =
259259
self.infcx.canonicalize_query(&(self.param_env, self_ty), &mut orig_values);
260260

261-
// XXX: consider caching this "whole op" here.
261+
// FIXME: consider caching this "whole op" here.
262262
let steps = if mode == Mode::MethodCall {
263263
create_steps_inner(self.tcx.global_tcx(), span, param_env_and_self_ty)
264264
} else {
265-
// XXX: don't make an inference context for nothing here
265+
// FIXME: don't make an inference context for nothing here
266266
self.tcx.global_tcx().infer_ctxt().enter(|ref infcx| {
267267
let ((_, self_ty), canonical_inference_vars) =
268-
infcx.instantiate_canonical_with_fresh_inference_vars(span, &param_env_and_self_ty);
268+
infcx.instantiate_canonical_with_fresh_inference_vars(
269+
span, &param_env_and_self_ty);
269270
CreateStepsResult {
270271
steps: vec![CandidateStep {
271272
self_ty: do_make_query_result(infcx, &canonical_inference_vars, self_ty),
@@ -324,7 +325,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
324325
// that we create during the probe process are removed later
325326
self.probe(|_| {
326327
let mut probe_cx = ProbeContext::new(
327-
self, span, mode, method_name, return_type, orig_values, Rc::new(steps.steps), is_suggestion,
328+
self, span, mode, method_name, return_type, orig_values,
329+
Rc::new(steps.steps), is_suggestion,
328330
);
329331

330332
probe_cx.assemble_inherent_candidates();
@@ -419,7 +421,8 @@ fn create_steps_inner<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'gcx>,
419421
let dereferences = steps.len() - 1;
420422

421423
steps.push(CandidateStep {
422-
self_ty: do_make_query_result(infcx, &inference_vars, infcx.tcx.mk_slice(elem_ty)),
424+
self_ty: do_make_query_result(infcx, &inference_vars,
425+
infcx.tcx.mk_slice(elem_ty)),
423426
autoderefs: dereferences,
424427
// this could be from an unsafe deref if we had
425428
// a *mut/const [T; N]
@@ -516,8 +519,9 @@ impl<'a, 'gcx, 'tcx> ProbeContext<'a, 'gcx, 'tcx> {
516519
ty::Dynamic(ref data, ..) => {
517520
if let Some(p) = data.principal() {
518521
self.fcx.probe(|_| {
519-
let InferOk { value: self_ty, obligations: _ } = do_instantiate_query_result(
520-
self.fcx, self.span, &self.orig_values, self_ty)
522+
let InferOk { value: self_ty, obligations: _ } =
523+
do_instantiate_query_result(self.fcx, self.span,
524+
&self.orig_values, self_ty)
521525
.unwrap_or_else(|_| {
522526
span_bug!(self.span, "{:?} was applicable but now isn't?", self_ty)
523527
});
@@ -693,7 +697,8 @@ impl<'a, 'gcx, 'tcx> ProbeContext<'a, 'gcx, 'tcx> {
693697
if let Some(p) = data.principal() {
694698
p
695699
} else {
696-
span_bug!(self.span, "bad object {:?} in assemble_inherent_candidates_from_object",
700+
span_bug!(self.span,
701+
"bad object {:?} in assemble_inherent_candidates_from_object",
697702
self_ty);
698703
}
699704
},
@@ -1017,7 +1022,10 @@ impl<'a, 'gcx, 'tcx> ProbeContext<'a, 'gcx, 'tcx> {
10171022
})
10181023
}
10191024

1020-
fn pick_autorefd_method(&mut self, step: &CandidateStep<'gcx>, self_ty: Ty<'tcx>, mutbl: hir::Mutability)
1025+
fn pick_autorefd_method(&mut self,
1026+
step: &CandidateStep<'gcx>,
1027+
self_ty: Ty<'tcx>,
1028+
mutbl: hir::Mutability)
10211029
-> Option<PickResult<'tcx>> {
10221030
let tcx = self.tcx;
10231031

0 commit comments

Comments
 (0)