From 1523de34a2267b624f1b920c1b4496568bd8c16b Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Wed, 27 Jun 2018 16:17:49 -0400 Subject: [PATCH] rustfmt various files --- src/librustc/infer/canonical/query_result.rs | 5 +++-- src/librustc/traits/query/type_op/eq.rs | 5 ++++- src/librustc/traits/query/type_op/prove_predicate.rs | 9 +++++---- src/librustc_traits/type_op.rs | 3 ++- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/librustc/infer/canonical/query_result.rs b/src/librustc/infer/canonical/query_result.rs index 24f70eb87575d..b8b13e03afaf9 100644 --- a/src/librustc/infer/canonical/query_result.rs +++ b/src/librustc/infer/canonical/query_result.rs @@ -56,7 +56,8 @@ impl<'cx, 'gcx, 'tcx> InferCtxtBuilder<'cx, 'gcx, 'tcx> { pub fn enter_canonical_trait_query( &'tcx mut self, canonical_key: &Canonical<'tcx, K>, - op: impl FnOnce(&InferCtxt<'_, 'gcx, 'tcx>, &mut FulfillmentContext<'tcx>, K) -> Fallible, + operation: impl FnOnce(&InferCtxt<'_, 'gcx, 'tcx>, &mut FulfillmentContext<'tcx>, K) + -> Fallible, ) -> Fallible> where K: TypeFoldable<'tcx>, @@ -66,7 +67,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxtBuilder<'cx, 'gcx, 'tcx> { let (key, canonical_inference_vars) = infcx.instantiate_canonical_with_fresh_inference_vars(DUMMY_SP, &canonical_key); let fulfill_cx = &mut FulfillmentContext::new(); - let value = op(infcx, fulfill_cx, key)?; + let value = operation(infcx, fulfill_cx, key)?; infcx.make_canonicalized_query_result(canonical_inference_vars, value, fulfill_cx) }) } diff --git a/src/librustc/traits/query/type_op/eq.rs b/src/librustc/traits/query/type_op/eq.rs index 799e52c6b1921..52a087cbc8069 100644 --- a/src/librustc/traits/query/type_op/eq.rs +++ b/src/librustc/traits/query/type_op/eq.rs @@ -27,7 +27,10 @@ impl<'tcx> Eq<'tcx> { impl<'gcx: 'tcx, 'tcx> super::QueryTypeOp<'gcx, 'tcx> for Eq<'tcx> { type QueryResult = (); - fn try_fast_path(_tcx: TyCtxt<'_, 'gcx, 'tcx>, key: &ParamEnvAnd<'tcx, Eq<'tcx>>) -> Option { + fn try_fast_path( + _tcx: TyCtxt<'_, 'gcx, 'tcx>, + key: &ParamEnvAnd<'tcx, Eq<'tcx>>, + ) -> Option { if key.value.a == key.value.b { Some(()) } else { diff --git a/src/librustc/traits/query/type_op/prove_predicate.rs b/src/librustc/traits/query/type_op/prove_predicate.rs index 4bb7a8f8d52dc..33dc3210f0881 100644 --- a/src/librustc/traits/query/type_op/prove_predicate.rs +++ b/src/librustc/traits/query/type_op/prove_predicate.rs @@ -19,16 +19,17 @@ pub struct ProvePredicate<'tcx> { impl<'tcx> ProvePredicate<'tcx> { pub fn new(predicate: Predicate<'tcx>) -> Self { - ProvePredicate { - predicate, - } + ProvePredicate { predicate } } } impl<'gcx: 'tcx, 'tcx> super::QueryTypeOp<'gcx, 'tcx> for ProvePredicate<'tcx> { type QueryResult = (); - fn try_fast_path(_tcx: TyCtxt<'_, 'gcx, 'tcx>, _key: &ParamEnvAnd<'tcx, Self>) -> Option { + fn try_fast_path( + _tcx: TyCtxt<'_, 'gcx, 'tcx>, + _key: &ParamEnvAnd<'tcx, Self>, + ) -> Option { None } diff --git a/src/librustc_traits/type_op.rs b/src/librustc_traits/type_op.rs index ca746722f5810..8fe4290528e74 100644 --- a/src/librustc_traits/type_op.rs +++ b/src/librustc_traits/type_op.rs @@ -15,7 +15,8 @@ use rustc::traits::query::type_op::normalize::Normalize; use rustc::traits::query::type_op::prove_predicate::ProvePredicate; use rustc::traits::query::type_op::subtype::Subtype; use rustc::traits::query::{Fallible, NoSolution}; -use rustc::traits::{FulfillmentContext, Normalized, Obligation, ObligationCause, TraitEngine, TraitEngineExt}; +use rustc::traits::{FulfillmentContext, Normalized, Obligation, ObligationCause, TraitEngine, + TraitEngineExt}; use rustc::ty::query::Providers; use rustc::ty::{FnSig, Lift, ParamEnvAnd, PolyFnSig, Predicate, Ty, TyCtxt, TypeFoldable}; use rustc_data_structures::sync::Lrc;