Remove BorrowKind glob, make names longer
This commit is contained in:
parent
b14362f665
commit
efeed550c4
6 changed files with 10 additions and 10 deletions
|
|
@ -1209,8 +1209,8 @@ pub fn can_move_expr_to_closure<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'
|
|||
let capture = match capture.info.capture_kind {
|
||||
UpvarCapture::ByValue => CaptureKind::Value,
|
||||
UpvarCapture::ByRef(kind) => match kind {
|
||||
BorrowKind::ImmBorrow => CaptureKind::Ref(Mutability::Not),
|
||||
BorrowKind::UniqueImmBorrow | BorrowKind::MutBorrow => {
|
||||
BorrowKind::Immutable => CaptureKind::Ref(Mutability::Not),
|
||||
BorrowKind::UniqueImmutable | BorrowKind::Mutable => {
|
||||
CaptureKind::Ref(Mutability::Mut)
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ impl<'tcx> Delegate<'tcx> for MutVarsDelegate {
|
|||
fn consume(&mut self, _: &PlaceWithHirId<'tcx>, _: HirId) {}
|
||||
|
||||
fn borrow(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId, bk: ty::BorrowKind) {
|
||||
if bk == ty::BorrowKind::MutBorrow {
|
||||
if bk == ty::BorrowKind::Mutable {
|
||||
self.update(cmt);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue