Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guide: specify that both shared and mutable borrows can be re-lent. #17992

Merged
merged 1 commit into from
Oct 14, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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