@@ -3668,15 +3668,20 @@ because it's easy. And if you need precise control over when something is
36683668deallocated, leaving it up to your runtime can make this difficult.
36693669
36703670Rust chooses a different path, and that path is called ** ownership** . Any
3671- binding that creates a resource is the ** owner** of that resource. Being an
3672- owner gives you three privileges, with two restrictions:
3671+ binding that creates a resource is the ** owner** of that resource.
3672+
3673+ Being an owner affords you some privileges:
36733674
367436751 . You control when that resource is deallocated.
367536762 . You may lend that resource, immutably, to as many borrowers as you'd like.
3676- 3 . You may lend that resource, mutably, to a single borrower. ** BUT**
3677- 4 . Once you've done so, you may not also lend it out otherwise, mutably or
3678- immutably.
3679- 5 . You may not lend it out mutably if you're currently lending it to someone.
3677+ 3 . You may lend that resource, mutably, to a single borrower.
3678+
3679+ But it also comes with some restrictions:
3680+
3681+ 1 . If someone is borrowing your resource (either mutably or immutably), you may
3682+ not mutate the resource or mutably lend it to someone.
3683+ 2 . If someone is mutably borrowing your resource, you may not lend it out at
3684+ all (mutably or immutably) or access it in any way.
36803685
36813686What's up with all this 'lending' and 'borrowing'? When you allocate memory,
36823687you get a pointer to that memory. This pointer allows you to manipulate said
0 commit comments