Skip to content

Commit

Permalink
some grammar corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
pvdrz committed Feb 26, 2018
1 parent 397ce8a commit 9091584
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/libcore/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@
//! Rust memory safety is based on this rule: Given an object `T`, it is only possible to
//! have one of the following:
//!
//! - Having several immutable references (`&T`) to the object (also know as Aliasing).
//! - Having one mutable reference (`&mut T`) to the object (also know as Mutability).
//! - Having several immutable references (`&T`) to the object (also known as **aliasing**).
//! - Having one mutable reference (`&mut T`) to the object (also known as **mutability**).
//!
//! This is enforced by the Rust compiler. However, there are situations where this rule is not
//! flexible enough. Sometimes it is required to have multiple references to an object and yet
//! mutate it.
//!
//! Shareable mutable containers exist to permit mutability in the presence of aliasing in a
//! controlled manner. Both `Cell<T>` and `RefCell<T>` allows to do this in a single threaded
//! Shareable mutable containers exist to permit mutability in a controlled manner, even in the
//! presence of aliasing. Both `Cell<T>` and `RefCell<T>` allows to do this in a single threaded
//! way. However, neither `Cell<T>` nor `RefCell<T>` are thread safe (they do not implement
//! `Sync`), if you need to do Aliasing and Mutation between multiple threads is possible to use
//! [`Mutex`](../../std/sync/struct.Mutex.html), [`RwLock`](../../std/sync/struct.RwLock.html) or
//! `Sync`). If you need to do aliasing and mutation between multiple threads it is possible to
//! use [`Mutex`](../../std/sync/struct.Mutex.html),
//! [`RwLock`](../../std/sync/struct.RwLock.html) or
//! [`atomic`](../../core/sync/atomic/index.html) types.
//!
//! Values of the `Cell<T>` and `RefCell<T>` types may be mutated through shared references (i.e.
Expand Down

0 comments on commit 9091584

Please sign in to comment.