improve wording
[web.git] / ralf / _posts / 2019-04-30-stacked-borrows-2.md
index 5b2abb0a5e8d0fc67deedabf994938698e0fc823..573182609c221ac984791687f4efaaa408fa3a44 100644 (file)
@@ -22,7 +22,7 @@ I didn't plan this out in advance, so things are a bit more messy than I would l
 ## The problem
 
 The problem I wanted to solve with Stacked Borrows 2 was that the first version of Stacked Borrows only performed very little tracking of shared references.
-My thinking was, if the location is read-only anyway, then it does not harm to grant anyone read access.
+My thinking was, if the location is read-only anyway, then it is not harmful to grant anyone read access.
 However, [as @arielby noted](https://github.com/rust-lang/unsafe-code-guidelines/issues/87), this leads to loss of optimization potential in cases where a function receives a mutable reference (which is supposed to have no aliases) and then creates a shared reference from it:
 {% highlight rust %}
 fn main() {
@@ -209,7 +209,7 @@ fn foo(a: &mut u32, y: *mut u32) -> u32 {
 {% endhighlight %}
 Initially, `x` with tag `Tagged(0)` is the only reference, and the stack says that this is the only pointer with any kind of permission.
 Next, we cast `x` to a raw pointer.
-The raw retagging of `p` turns `p` into an `Untagged` pointer, and adds a new item granting thusly tagged pointers `SharedReadWrite` permission.
+The raw retagging of `p` turns `p` into an `Untagged` pointer, and adds a new item granting `Untagged` pointers `SharedReadWrite` permission.
 (Really, in the MIR it will say `&mut *x as *mut u32`, so there will be an additional `Unique` permission for the temporary mutable reference, but that makes no difference and I hope [we will change that eventually](https://github.com/rust-lang/rfcs/pull/2582).)
 
 Then `foo` gets called, which starts with the usual retagging of all reference arguments.