Fix tidy.

This commit is contained in:
Camille GILLOT 2019-11-09 19:22:30 +01:00
parent daff3e346c
commit 76128f89a1
4 changed files with 11 additions and 5 deletions

View file

@ -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),

View file

@ -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] <-

View file

@ -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");

View file

@ -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