Add AutoBorrowMutability; its like hir::Mutability but w/ two-phase borrow info too.

Namely, the mutable borrows also carries a flag indicating whether
they should support two-phase borrows.

This allows us to thread down, from the point of the borrow's
introduction, whether the particular adjustment that created it is one
that yields two-phase mutable borrows.
This commit is contained in:
Felix S. Klock II 2018-01-23 13:31:11 +01:00
parent 1855ab7424
commit c8041dd8ac
11 changed files with 154 additions and 28 deletions

View file

@ -760,7 +760,7 @@ impl<'a, 'gcx, 'tcx> ExprUseVisitor<'a, 'gcx, 'tcx> {
expr.span,
cmt_base,
r,
ty::BorrowKind::from_mutbl(m),
ty::BorrowKind::from_mutbl(m.into()),
AutoRef);
}