From 8710a2e169a6b008734b75f3f86f79d93319fbfd Mon Sep 17 00:00:00 2001 From: Deadbeef Date: Mon, 29 Nov 2021 21:12:53 +0800 Subject: [PATCH] Reformat everything --- compiler/rustc_infer/src/traits/engine.rs | 6 ++---- compiler/rustc_middle/src/ty/mod.rs | 5 ++++- .../rustc_trait_selection/src/traits/select/mod.rs | 5 +---- compiler/rustc_typeck/src/check/compare_method.rs | 3 +-- compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs | 10 ++-------- src/test/ui/rfc-2632-const-trait-impl/assoc-type.rs | 2 +- 6 files changed, 11 insertions(+), 20 deletions(-) diff --git a/compiler/rustc_infer/src/traits/engine.rs b/compiler/rustc_infer/src/traits/engine.rs index 2f561582788..822f2365e02 100644 --- a/compiler/rustc_infer/src/traits/engine.rs +++ b/compiler/rustc_infer/src/traits/engine.rs @@ -47,10 +47,8 @@ fn register_predicate_obligation( fn select_all_or_error(&mut self, infcx: &InferCtxt<'_, 'tcx>) -> Vec>; - fn select_where_possible( - &mut self, - infcx: &InferCtxt<'_, 'tcx>, - ) -> Vec>; + fn select_where_possible(&mut self, infcx: &InferCtxt<'_, 'tcx>) + -> Vec>; fn pending_obligations(&self) -> Vec>; diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index da4a414d7cb..72191bce4c7 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -1256,7 +1256,10 @@ fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHas } impl<'tcx> TypeFoldable<'tcx> for ParamEnv<'tcx> { - fn super_fold_with>(self, folder: &mut F) -> Result { + fn super_fold_with>( + self, + folder: &mut F, + ) -> Result { Ok(ParamEnv::new( self.caller_bounds().fold_with(folder)?, self.reveal().fold_with(folder)?, diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index e1ab9bba459..dde4529a21b 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -2144,10 +2144,7 @@ fn push_stack<'o>( previous_stack: TraitObligationStackList<'o, 'tcx>, obligation: &'o TraitObligation<'tcx>, ) -> TraitObligationStack<'o, 'tcx> { - let fresh_trait_pred = obligation - .predicate - .fold_with(&mut self.freshener) - .into_ok(); + let fresh_trait_pred = obligation.predicate.fold_with(&mut self.freshener).into_ok(); let dfn = previous_stack.cache.next_dfn(); let depth = previous_stack.depth() + 1; diff --git a/compiler/rustc_typeck/src/check/compare_method.rs b/compiler/rustc_typeck/src/check/compare_method.rs index 8141950ee8d..7ce4c476d3a 100644 --- a/compiler/rustc_typeck/src/check/compare_method.rs +++ b/compiler/rustc_typeck/src/check/compare_method.rs @@ -1432,8 +1432,7 @@ pub fn check_type_bounds<'tcx>( // Check that all obligations are satisfied by the implementation's // version. - let errors = - inh.fulfillment_cx.borrow_mut().select_all_or_error(&infcx); + let errors = inh.fulfillment_cx.borrow_mut().select_all_or_error(&infcx); if !errors.is_empty() { infcx.report_fulfillment_errors(&errors, None, false); return Err(ErrorReported); diff --git a/compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs b/compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs index 58a2f21d22e..6dbcf3c3c6e 100644 --- a/compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs +++ b/compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs @@ -610,10 +610,7 @@ pub(in super::super) fn resolve_generator_interiors(&self, def_id: DefId) { #[instrument(skip(self), level = "debug")] pub(in super::super) fn select_all_obligations_or_error(&self) { - let errors = self - .fulfillment_cx - .borrow_mut() - .select_all_or_error(&self); + let errors = self.fulfillment_cx.borrow_mut().select_all_or_error(&self); if !errors.is_empty() { self.report_fulfillment_errors(&errors, self.inh.body_id, false); @@ -626,10 +623,7 @@ pub(in super::super) fn select_obligations_where_possible( fallback_has_occurred: bool, mutate_fulfillment_errors: impl Fn(&mut Vec>), ) { - let mut result = self - .fulfillment_cx - .borrow_mut() - .select_where_possible(self); + let mut result = self.fulfillment_cx.borrow_mut().select_where_possible(self); if !result.is_empty() { mutate_fulfillment_errors(&mut result); self.report_fulfillment_errors(&result, self.inh.body_id, fallback_has_occurred); diff --git a/src/test/ui/rfc-2632-const-trait-impl/assoc-type.rs b/src/test/ui/rfc-2632-const-trait-impl/assoc-type.rs index 321cea0d415..11334c10775 100644 --- a/src/test/ui/rfc-2632-const-trait-impl/assoc-type.rs +++ b/src/test/ui/rfc-2632-const-trait-impl/assoc-type.rs @@ -28,4 +28,4 @@ impl const Baz for NonConstAdd { type Qux = NonConstAdd; // OK } -fn main() {} \ No newline at end of file +fn main() {} -- 2.44.0