parent
f168c12c56
commit
2877e47ea7
1 changed files with 9 additions and 1 deletions
|
|
@ -825,12 +825,20 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
|
|||
mc::cat_rvalue(..) |
|
||||
mc::cat_static_item |
|
||||
mc::cat_deref(_, _, mc::UnsafePtr(..)) |
|
||||
mc::cat_deref(_, _, mc::BorrowedPtr(..)) |
|
||||
mc::cat_deref(_, _, mc::Implicit(..)) => {
|
||||
assert_eq!(cmt.mutbl, mc::McDeclared);
|
||||
return;
|
||||
}
|
||||
|
||||
mc::cat_deref(_, _, mc::BorrowedPtr(..)) => {
|
||||
assert_eq!(cmt.mutbl, mc::McDeclared);
|
||||
// We need to drill down to upvar if applicable
|
||||
match cmt.upvar() {
|
||||
Some(b) => cmt = b,
|
||||
None => return
|
||||
}
|
||||
}
|
||||
|
||||
mc::cat_discr(b, _) |
|
||||
mc::cat_deref(b, _, mc::OwnedPtr) => {
|
||||
assert_eq!(cmt.mutbl, mc::McInherited);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue