librustc: Disallow &mut loans from overlapping with any other loans
This commit is contained in:
parent
163b97b7bb
commit
bbbb80559c
4 changed files with 15 additions and 10 deletions
|
|
@ -12,7 +12,7 @@ fn main() {
|
|||
let x = ~{mut a: ~10, b: ~20};
|
||||
match x {
|
||||
~{a: ref mut a, b: ref b} => {
|
||||
assert **a == 10; (*x).a = ~30; assert **a == 30;
|
||||
assert **a == 10; *a = ~30; assert **a == 30;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue