diff --git a/src/librustc/hir/map/collector.rs b/src/librustc/hir/map/collector.rs index 532e61721ca45..8a59f6b69bcd6 100644 --- a/src/librustc/hir/map/collector.rs +++ b/src/librustc/hir/map/collector.rs @@ -590,7 +590,8 @@ struct HirItemLike { } impl<'hir, T> HashStable> for HirItemLike - where T: HashStable> +where + T: HashStable>, { fn hash_stable(&self, hcx: &mut StableHashingContext<'hir>, diff --git a/src/librustc/ich/hcx.rs b/src/librustc/ich/hcx.rs index 8454eb75b55c7..eff42efa67b92 100644 --- a/src/librustc/ich/hcx.rs +++ b/src/librustc/ich/hcx.rs @@ -397,8 +397,9 @@ pub fn hash_stable_trait_impls<'a, W>( hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher, blanket_impls: &[DefId], - non_blanket_impls: &FxHashMap>) - where W: StableHasherResult + non_blanket_impls: &FxHashMap>, +) where + W: StableHasherResult, { { let mut blanket_impls: SmallVec<[_; 8]> = blanket_impls diff --git a/src/librustc/ich/impls_ty.rs b/src/librustc/ich/impls_ty.rs index c2c0ced07e695..89e79c56ca39d 100644 --- a/src/librustc/ich/impls_ty.rs +++ b/src/librustc/ich/impls_ty.rs @@ -136,7 +136,8 @@ impl<'gcx> HashStable> for ty::BoundVar { } impl<'a, T> HashStable> for ty::Binder - where T: HashStable> +where + T: HashStable>, { fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, @@ -192,9 +193,7 @@ impl<'a> ToStableHashKey> for region::Scope { } } -impl<'a> HashStable> -for ty::TyVid -{ +impl<'a> HashStable> for ty::TyVid { fn hash_stable(&self, _hcx: &mut StableHashingContext<'a>, _hasher: &mut StableHasher) { @@ -204,9 +203,7 @@ for ty::TyVid } } -impl<'a> HashStable> -for ty::IntVid -{ +impl<'a> HashStable> for ty::IntVid { fn hash_stable(&self, _hcx: &mut StableHashingContext<'a>, _hasher: &mut StableHasher) { @@ -216,9 +213,7 @@ for ty::IntVid } } -impl<'a> HashStable> -for ty::FloatVid -{ +impl<'a> HashStable> for ty::FloatVid { fn hash_stable(&self, _hcx: &mut StableHashingContext<'a>, _hasher: &mut StableHasher) { @@ -228,9 +223,9 @@ for ty::FloatVid } } -impl<'a, T> HashStable> -for ty::steal::Steal - where T: HashStable> +impl<'a, T> HashStable> for ty::steal::Steal +where + T: HashStable>, { fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, diff --git a/src/librustc/traits/select.rs b/src/librustc/traits/select.rs index c637fc27cc0ca..af0b51e637a36 100644 --- a/src/librustc/traits/select.rs +++ b/src/librustc/traits/select.rs @@ -104,10 +104,7 @@ pub enum IntercrateAmbiguityCause { impl IntercrateAmbiguityCause { /// Emits notes when the overlap is caused by complex intercrate ambiguities. /// See #23980 for details. - pub fn add_intercrate_ambiguity_hint( - &self, - err: &mut errors::DiagnosticBuilder<'_>, - ) { + pub fn add_intercrate_ambiguity_hint(&self, err: &mut errors::DiagnosticBuilder<'_>) { err.note(&self.intercrate_ambiguity_hint()); } diff --git a/src/librustc/ty/fast_reject.rs b/src/librustc/ty/fast_reject.rs index 3ac76c384e605..908bbbcd1d77d 100644 --- a/src/librustc/ty/fast_reject.rs +++ b/src/librustc/ty/fast_reject.rs @@ -155,8 +155,8 @@ impl SimplifiedTypeGen { } impl<'a, D> HashStable> for SimplifiedTypeGen - where D: Copy + Debug + Ord + Eq + Hash + - HashStable>, +where + D: Copy + Debug + Ord + Eq + Hash + HashStable>, { fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, diff --git a/src/librustc/ty/instance.rs b/src/librustc/ty/instance.rs index cee1359eb366b..ba42cecbe5b83 100644 --- a/src/librustc/ty/instance.rs +++ b/src/librustc/ty/instance.rs @@ -442,10 +442,10 @@ fn resolve_associated_item<'a, 'tcx>( } } -fn needs_fn_once_adapter_shim(actual_closure_kind: ty::ClosureKind, - trait_closure_kind: ty::ClosureKind) - -> Result -{ +fn needs_fn_once_adapter_shim( + actual_closure_kind: ty::ClosureKind, + trait_closure_kind: ty::ClosureKind, +) -> Result { match (actual_closure_kind, trait_closure_kind) { (ty::ClosureKind::Fn, ty::ClosureKind::Fn) | (ty::ClosureKind::FnMut, ty::ClosureKind::FnMut) | diff --git a/src/librustc/ty/layout.rs b/src/librustc/ty/layout.rs index 879d03352e654..4696325275292 100644 --- a/src/librustc/ty/layout.rs +++ b/src/librustc/ty/layout.rs @@ -1679,9 +1679,10 @@ impl ty::query::TyCtxtAt<'a, 'tcx, '_> { } impl<'tcx, C> TyLayoutMethods<'tcx, C> for Ty<'tcx> - where C: LayoutOf> + HasTyCtxt<'tcx>, - C::TyLayout: MaybeResult>, - C: HasParamEnv<'tcx> +where + C: LayoutOf> + HasTyCtxt<'tcx>, + C::TyLayout: MaybeResult>, + C: HasParamEnv<'tcx>, { fn for_variant(this: TyLayout<'tcx>, cx: &C, variant_index: VariantIdx) -> TyLayout<'tcx> { let details = match this.variants { diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index aafc510f5b6ed..c46e9c4be366c 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -1615,7 +1615,8 @@ pub struct Placeholder { } impl<'a, T> HashStable> for Placeholder - where T: HashStable> +where + T: HashStable>, { fn hash_stable( &self, diff --git a/src/librustc_codegen_ssa/mir/block.rs b/src/librustc_codegen_ssa/mir/block.rs index 07bfd5653ce15..e4b82d8496669 100644 --- a/src/librustc_codegen_ssa/mir/block.rs +++ b/src/librustc_codegen_ssa/mir/block.rs @@ -223,10 +223,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { } } - fn codegen_return_terminator( - &mut self, - mut bx: Bx, - ) { + fn codegen_return_terminator(&mut self, mut bx: Bx) { if self.fn_ty.c_variadic { match self.va_list_ref { Some(va_list) => { diff --git a/src/librustc_lint/types.rs b/src/librustc_lint/types.rs index 7c185ba7423ad..809586e246a35 100644 --- a/src/librustc_lint/types.rs +++ b/src/librustc_lint/types.rs @@ -202,11 +202,7 @@ fn report_bin_hex_error( // - `uX` => `uY` // // No suggestion for: `isize`, `usize`. -fn get_type_suggestion( - t: Ty<'_>, - val: u128, - negative: bool, -) -> Option { +fn get_type_suggestion(t: Ty<'_>, val: u128, negative: bool) -> Option { use syntax::ast::IntTy::*; use syntax::ast::UintTy::*; macro_rules! find_fit { diff --git a/src/librustc_mir/build/matches/mod.rs b/src/librustc_mir/build/matches/mod.rs index fbb6161e8fe5b..0aabebcf9dc2c 100644 --- a/src/librustc_mir/build/matches/mod.rs +++ b/src/librustc_mir/build/matches/mod.rs @@ -1575,11 +1575,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> { /// Append `AscribeUserType` statements onto the end of `block` /// for each ascription - fn ascribe_types( - &mut self, - block: BasicBlock, - ascriptions: &[Ascription<'tcx>], - ) { + fn ascribe_types(&mut self, block: BasicBlock, ascriptions: &[Ascription<'tcx>]) { for ascription in ascriptions { let source_info = self.source_info(ascription.span); diff --git a/src/librustc_mir/util/elaborate_drops.rs b/src/librustc_mir/util/elaborate_drops.rs index 0fbf8bb3e273a..b8ce31d0adfdc 100644 --- a/src/librustc_mir/util/elaborate_drops.rs +++ b/src/librustc_mir/util/elaborate_drops.rs @@ -119,7 +119,8 @@ pub fn elaborate_drop<'b, 'tcx, D>( } impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D> - where D: DropElaborator<'b, 'tcx> +where + D: DropElaborator<'b, 'tcx>, { fn place_ty(&self, place: &Place<'tcx>) -> Ty<'tcx> { place.ty(self.elaborator.body(), self.tcx()).ty @@ -285,12 +286,12 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D> /// /// NOTE: this does not clear the master drop flag, so you need /// to point succ/unwind on a `drop_ladder_bottom`. - fn drop_ladder(&mut self, - fields: Vec<(Place<'tcx>, Option)>, - succ: BasicBlock, - unwind: Unwind) - -> (BasicBlock, Unwind) - { + fn drop_ladder( + &mut self, + fields: Vec<(Place<'tcx>, Option)>, + succ: BasicBlock, + unwind: Unwind, + ) -> (BasicBlock, Unwind) { debug!("drop_ladder({:?}, {:?})", self, fields); let mut fields = fields; @@ -314,9 +315,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D> (*normal_ladder.last().unwrap(), *unwind_ladder.last().unwrap()) } - fn open_drop_for_tuple(&mut self, tys: &[Ty<'tcx>]) - -> BasicBlock - { + fn open_drop_for_tuple(&mut self, tys: &[Ty<'tcx>]) -> BasicBlock { debug!("open_drop_for_tuple({:?}, {:?})", self, tys); let fields = tys.iter().enumerate().map(|(i, &ty)| { @@ -328,9 +327,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D> self.drop_ladder(fields, succ, unwind).0 } - fn open_drop_for_box(&mut self, adt: &'tcx ty::AdtDef, substs: SubstsRef<'tcx>) - -> BasicBlock - { + fn open_drop_for_box(&mut self, adt: &'tcx ty::AdtDef, substs: SubstsRef<'tcx>) -> BasicBlock { debug!("open_drop_for_box({:?}, {:?}, {:?})", self, adt, substs); let interior = self.place.clone().deref(); @@ -346,8 +343,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D> self.drop_subpath(&interior, interior_path, succ, unwind_succ) } - fn open_drop_for_adt(&mut self, adt: &'tcx ty::AdtDef, substs: SubstsRef<'tcx>) - -> BasicBlock { + fn open_drop_for_adt(&mut self, adt: &'tcx ty::AdtDef, substs: SubstsRef<'tcx>) -> BasicBlock { debug!("open_drop_for_adt({:?}, {:?}, {:?})", self, adt, substs); if adt.variants.len() == 0 { return self.elaborator.patch().new_block(BasicBlockData { @@ -505,9 +501,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D> self.drop_flag_test_block(switch_block, succ, unwind) } - fn destructor_call_block(&mut self, (succ, unwind): (BasicBlock, Unwind)) - -> BasicBlock - { + fn destructor_call_block(&mut self, (succ, unwind): (BasicBlock, Unwind)) -> BasicBlock { debug!("destructor_call_block({:?}, {:?})", self, succ); let tcx = self.tcx(); let drop_trait = tcx.lang_items().drop_trait().unwrap(); @@ -837,11 +831,12 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D> /// if FLAG(self.path) /// if let Some(mode) = mode: FLAG(self.path)[mode] = false /// drop(self.place) - fn complete_drop(&mut self, - drop_mode: Option, - succ: BasicBlock, - unwind: Unwind) -> BasicBlock - { + fn complete_drop( + &mut self, + drop_mode: Option, + succ: BasicBlock, + unwind: Unwind, + ) -> BasicBlock { debug!("complete_drop({:?},{:?})", self, drop_mode); let drop_block = self.drop_block(succ, unwind); @@ -892,7 +887,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D> adt: &'tcx ty::AdtDef, substs: SubstsRef<'tcx>, target: BasicBlock, - unwind: Unwind + unwind: Unwind, ) -> BasicBlock { let tcx = self.tcx(); let unit_temp = Place::Base(PlaceBase::Local(self.new_temp(tcx.mk_unit()))); @@ -947,11 +942,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D> } } - fn new_block(&mut self, - unwind: Unwind, - k: TerminatorKind<'tcx>) - -> BasicBlock - { + fn new_block(&mut self, unwind: Unwind, k: TerminatorKind<'tcx>) -> BasicBlock { self.elaborator.patch().new_block(BasicBlockData { statements: vec![], terminator: Some(Terminator { diff --git a/src/libsyntax_ext/cfg.rs b/src/libsyntax_ext/cfg.rs index 3b49f218811ad..e952515bfe0eb 100644 --- a/src/libsyntax_ext/cfg.rs +++ b/src/libsyntax_ext/cfg.rs @@ -12,10 +12,11 @@ use syntax::tokenstream; use syntax::parse::token; use syntax_pos::Span; -pub fn expand_cfg(cx: &mut ExtCtxt<'_>, - sp: Span, - tts: &[tokenstream::TokenTree]) - -> Box { +pub fn expand_cfg( + cx: &mut ExtCtxt<'_>, + sp: Span, + tts: &[tokenstream::TokenTree], +) -> Box { let sp = sp.apply_mark(cx.current_expansion.mark); match parse_cfg(cx, sp, tts) {