Skip to content

Commit

Permalink
Guide: specify that both shared and mutable borrows can be re-lent.
Browse files Browse the repository at this point in the history
  • Loading branch information
John Kleint committed Oct 13, 2014
1 parent ff61b74 commit ed7d1be
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/doc/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -3538,9 +3538,8 @@ restriction:

1. If the borrow is immutable, you may read the data the pointer points to.
2. If the borrow is mutable, you may read and write the data the pointer points to.
3. You may lend the pointer to someone else in an immutable fashion, **BUT**
4. When you do so, they must return it to you before you must give your own
borrow back.
3. You may lend the pointer to someone else, **BUT**
4. When you do so, they must return it before you can give your own borrow back.

This last requirement can seem odd, but it also makes sense. If you have to
return something, and you've lent it to someone, they need to give it back to
Expand Down

0 comments on commit ed7d1be

Please sign in to comment.