|
|
|
@ -1,10 +1,10 @@
|
|
|
|
|
# Splitting Borrows
|
|
|
|
|
|
|
|
|
|
The mutual exclusion property of mutable references can be very limiting when
|
|
|
|
|
working with a composite structure. The borrow checker understands some basic
|
|
|
|
|
stuff, but will fall over pretty easily. It does understand structs
|
|
|
|
|
sufficiently to know that it's possible to borrow disjoint fields of a struct
|
|
|
|
|
simultaneously. So this works today:
|
|
|
|
|
working with a composite structure. The borrow checker (a.k.a. borrowck)
|
|
|
|
|
understands some basic stuff, but will fall over pretty easily. It does
|
|
|
|
|
understand structs sufficiently to know that it's possible to borrow disjoint
|
|
|
|
|
fields of a struct simultaneously. So this works today:
|
|
|
|
|
|
|
|
|
|
```rust
|
|
|
|
|
struct Foo {
|
|
|
|
|