diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2019-11-09 19:22:30 +0100 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2019-11-10 12:45:31 +0100 |
| commit | 76128f89a118ecd0fc2a69965e8a459105119c95 (patch) | |
| tree | 57392f84c184bead09b01a511102496208eade28 /src | |
| parent | daff3e346c4d8a79fdf20fcc92a7919c28f53840 (diff) | |
| download | rust-76128f89a118ecd0fc2a69965e8a459105119c95.tar.gz rust-76128f89a118ecd0fc2a69965e8a459105119c95.zip | |
Fix tidy.
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc/hir/pat_util.rs | 3 | ||||
| -rw-r--r-- | src/librustc_metadata/rmeta/encoder.rs | 6 | ||||
| -rw-r--r-- | src/librustc_mir/borrow_check/places_conflict.rs | 4 | ||||
| -rw-r--r-- | 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 c2bd998d5e9..97228c8f240 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 908561f55fd..26055d329bc 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 36586e80ee0..87a431a7fb8 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 81732ed4ba3..3245f2cca79 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<CastKind, CastError> { // 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 |
