X-Git-Url: https://git.ralfj.de/web.git/blobdiff_plain/9bfe062e102ffeb1ec5f1b159f625bebf1ad0349..09a57fbd0d9a22cda06212810a5b12f017619955:/personal/_posts/2018-11-16-stacked-borrows-implementation.md diff --git a/personal/_posts/2018-11-16-stacked-borrows-implementation.md b/personal/_posts/2018-11-16-stacked-borrows-implementation.md index dbea705..64f9e31 100644 --- a/personal/_posts/2018-11-16-stacked-borrows-implementation.md +++ b/personal/_posts/2018-11-16-stacked-borrows-implementation.md @@ -497,7 +497,7 @@ refine these instructions later) on all locations covered by the reference 3. Perform the actions that would also happen when an actual access happens through this reference (for shared references a read access, for mutable references a write access). -4. Check if the new tag is `Shr(Some(t))` and the location is inside an `UnsafeCell`. +4. Check if the new tag is `Shr(Some(t))` and the location is *not* inside an `UnsafeCell`. - If both conditions apply, freeze the location with timestamp `t`. If it is already frozen, do nothing. - Otherwise, push a new item onto the stack: `Shr` if the tag is a `Shr(_)`, @@ -669,9 +669,8 @@ executed on all locations covered by the reference, according to `size_of_val`): Now the location cannot be frozen any more: If the fresh tag is `Uniq`, we just unfroze; if the fresh tag is `Shr` and the location was already frozen, then the redundancy check (step 3) would have kicked in. -5. Check if the new tag is `Shr(Some(t))` and the location is inside an `UnsafeCell`. - - If both conditions apply, freeze the location with timestamp `t`. If it - is already frozen, do nothing. +5. Check if the new tag is `Shr(Some(t))` and the location is *not* inside an `UnsafeCell`. + - If both conditions apply, freeze the location with timestamp `t`. - Otherwise, push a new item onto the stack: `Shr` if the tag is a `Shr(_)`, `Uniq(id)` if the tag is `Uniq(id)`.