1
Fork 0

Add Span to StmtKind::Let.

This commit is contained in:
Camille GILLOT 2023-02-26 21:35:54 +00:00
parent 28d74a9b72
commit 3b47cdc439
6 changed files with 71 additions and 2 deletions

View file

@ -1984,6 +1984,13 @@ impl<'tcx> Rvalue<'tcx> {
}
impl BorrowKind {
pub fn mutability(&self) -> Mutability {
match *self {
BorrowKind::Shared | BorrowKind::Shallow | BorrowKind::Unique => Mutability::Not,
BorrowKind::Mut { .. } => Mutability::Mut,
}
}
pub fn allows_two_phase_borrow(&self) -> bool {
match *self {
BorrowKind::Shared | BorrowKind::Shallow | BorrowKind::Unique => false,