Skip to content

Commit a73df6b

Browse files
committed
Rollup merge of #30620 - salty-horse:an_mut, r=brson
As discussed in issue #30568.
2 parents 31edbad + e8e6492 commit a73df6b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/doc/book/choosing-your-guarantees.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -340,11 +340,11 @@ With the former, the `RefCell<T>` is wrapping the `Vec<T>`, so the `Vec<T>` in i
340340
mutable. At the same time, there can only be one mutable borrow of the whole `Vec` at a given time.
341341
This means that your code cannot simultaneously work on different elements of the vector from
342342
different `Rc` handles. However, we are able to push and pop from the `Vec<T>` at will. This is
343-
similar to an `&mut Vec<T>` with the borrow checking done at runtime.
343+
similar to a `&mut Vec<T>` with the borrow checking done at runtime.
344344

345345
With the latter, the borrowing is of individual elements, but the overall vector is immutable. Thus,
346346
we can independently borrow separate elements, but we cannot push or pop from the vector. This is
347-
similar to an `&mut [T]`[^3], but, again, the borrow checking is at runtime.
347+
similar to a `&mut [T]`[^3], but, again, the borrow checking is at runtime.
348348

349349
In concurrent programs, we have a similar situation with `Arc<Mutex<T>>`, which provides shared
350350
mutability and ownership.

src/doc/book/lifetimes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Then in our parameter list, we use the lifetimes we’ve named:
103103
...(x: &'a i32)
104104
```
105105

106-
If we wanted an `&mut` reference, we’d do this:
106+
If we wanted a `&mut` reference, we’d do this:
107107

108108
```rust,ignore
109109
...(x: &'a mut i32)

src/doc/book/references-and-borrowing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ the thing `y` points at. You’ll notice that `x` had to be marked `mut` as well
126126
If it wasn’t, we couldn’t take a mutable borrow to an immutable value.
127127

128128
You'll also notice we added an asterisk (`*`) in front of `y`, making it `*y`,
129-
this is because `y` is an `&mut` reference. You'll also need to use them for
129+
this is because `y` is a `&mut` reference. You'll also need to use them for
130130
accessing the contents of a reference as well.
131131

132132
Otherwise, `&mut` references are just like references. There _is_ a large

0 commit comments

Comments
 (0)