Skip to content

Commit ed7d1be

Browse files
author
John Kleint
committed
Guide: specify that both shared and mutable borrows can be re-lent.
1 parent ff61b74 commit ed7d1be

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/doc/guide.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3538,9 +3538,8 @@ restriction:
35383538

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

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

0 commit comments

Comments
 (0)