Unify &mut
and &raw mut
const-checking errors
This commit is contained in:
parent
2ad6187ce5
commit
77e6c56ab6
2 changed files with 15 additions and 29 deletions
|
@ -522,14 +522,16 @@ impl Visitor<'tcx> for Validator<'mir, 'tcx> {
|
|||
|
||||
if !is_allowed {
|
||||
if let BorrowKind::Mut { .. } = kind {
|
||||
self.check_op(ops::MutBorrow);
|
||||
self.check_op(ops::MutBorrow(hir::BorrowKind::Ref));
|
||||
} else {
|
||||
self.check_op(ops::CellBorrow);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rvalue::AddressOf(Mutability::Mut, _) => self.check_op(ops::MutAddressOf),
|
||||
Rvalue::AddressOf(Mutability::Mut, _) => {
|
||||
self.check_op(ops::MutBorrow(hir::BorrowKind::Raw))
|
||||
}
|
||||
|
||||
Rvalue::Ref(_, BorrowKind::Shared | BorrowKind::Shallow, ref place)
|
||||
| Rvalue::AddressOf(Mutability::Not, ref place) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue