From 76128f89a118ecd0fc2a69965e8a459105119c95 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sat, 9 Nov 2019 19:22:30 +0100 Subject: [PATCH] Fix tidy. --- src/librustc/hir/pat_util.rs | 3 ++- src/librustc_metadata/rmeta/encoder.rs | 6 ++++-- src/librustc_mir/borrow_check/places_conflict.rs | 4 +++- src/librustc_typeck/check/cast.rs | 3 ++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/librustc/hir/pat_util.rs b/src/librustc/hir/pat_util.rs index c2bd998d5e99..97228c8f2403 100644 --- a/src/librustc/hir/pat_util.rs +++ b/src/librustc/hir/pat_util.rs @@ -169,7 +169,8 @@ impl hir::Pat { self.each_binding(|annotation, _, _, _| { match annotation { hir::BindingAnnotation::Ref => match result { - None | Some(hir::Mutability::Immutable) => result = Some(hir::Mutability::Immutable), + None | Some(hir::Mutability::Immutable) => + result = Some(hir::Mutability::Immutable), _ => {} } hir::BindingAnnotation::RefMut => result = Some(hir::Mutability::Mutable), diff --git a/src/librustc_metadata/rmeta/encoder.rs b/src/librustc_metadata/rmeta/encoder.rs index 908561f55fd8..26055d329bcb 100644 --- a/src/librustc_metadata/rmeta/encoder.rs +++ b/src/librustc_metadata/rmeta/encoder.rs @@ -1571,8 +1571,10 @@ impl EncodeContext<'tcx> { }; EntryKind::ForeignFn(self.lazy(data)) } - hir::ForeignItemKind::Static(_, hir::Mutability::Mutable) => EntryKind::ForeignMutStatic, - hir::ForeignItemKind::Static(_, hir::Mutability::Immutable) => EntryKind::ForeignImmStatic, + hir::ForeignItemKind::Static(_, hir::Mutability::Mutable) => + EntryKind::ForeignMutStatic, + hir::ForeignItemKind::Static(_, hir::Mutability::Immutable) => + EntryKind::ForeignImmStatic, hir::ForeignItemKind::Type => EntryKind::ForeignType, }); record!(self.per_def.visibility[def_id] <- diff --git a/src/librustc_mir/borrow_check/places_conflict.rs b/src/librustc_mir/borrow_check/places_conflict.rs index 36586e80ee0f..87a431a7fb80 100644 --- a/src/librustc_mir/borrow_check/places_conflict.rs +++ b/src/librustc_mir/borrow_check/places_conflict.rs @@ -250,7 +250,9 @@ fn place_components_conflict<'tcx>( // Shouldn't be tracked bug!("Tracking borrow behind shared reference."); } - (ProjectionElem::Deref, ty::Ref(_, _, hir::Mutability::Mutable), AccessDepth::Drop) => { + (ProjectionElem::Deref, + ty::Ref(_, _, hir::Mutability::Mutable), + AccessDepth::Drop) => { // Values behind a mutable reference are not access either by dropping a // value, or by StorageDead debug!("borrow_conflicts_with_place: drop access behind ptr"); diff --git a/src/librustc_typeck/check/cast.rs b/src/librustc_typeck/check/cast.rs index 81732ed4ba34..3245f2cca79c 100644 --- a/src/librustc_typeck/check/cast.rs +++ b/src/librustc_typeck/check/cast.rs @@ -627,7 +627,8 @@ impl<'a, 'tcx> CastCheck<'tcx> { ) -> Result { // array-ptr-cast. - if m_expr.mutbl == hir::Mutability::Immutable && m_cast.mutbl == hir::Mutability::Immutable { + if m_expr.mutbl == hir::Mutability::Immutable && + m_cast.mutbl == hir::Mutability::Immutable { if let ty::Array(ety, _) = m_expr.ty.kind { // Due to the limitations of LLVM global constants, // region pointers end up pointing at copies of