]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #27419 - cpjreynolds:master, r=Gankro
authorManish Goregaokar <manishsmail@gmail.com>
Sat, 1 Aug 2015 07:01:23 +0000 (12:31 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Sat, 1 Aug 2015 08:35:52 +0000 (14:05 +0530)
Corrects formatting of bullet-ed sentences and changes 'pervasive use raw pointers' to 'pervasive use of raw pointers'.

src/doc/tarpl/send-and-sync.md

index af8fb43f2e9133fcfeea1914347710732d4938e0..334d5c9dd55e3045b1884a1ff66c126a23176a34 100644 (file)
@@ -5,8 +5,8 @@ multiply alias a location in memory while mutating it. Unless these types use
 synchronization to manage this access, they are absolutely not thread safe. Rust
 captures this with through the `Send` and `Sync` traits.
 
-* A type is Send if it is safe to send it to another thread. A type is Sync if
-* it is safe to share between threads (`&T` is Send).
+* A type is Send if it is safe to send it to another thread.
+* A type is Sync if it is safe to share between threads (`&T` is Send).
 
 Send and Sync are fundamental to Rust's concurrency story. As such, a
 substantial amount of special tooling exists to make them work right. First and
@@ -24,9 +24,9 @@ pretty much all types you'll ever interact with are Send and Sync.
 
 Major exceptions include:
 
-* raw pointers are neither Send nor Sync (because they have no safety guards)
-* `UnsafeCell` isn't Sync (and therefore `Cell` and `RefCell` aren't) `Rc` isn't
-* Send or Sync (because the refcount is shared and unsynchronized)
+* raw pointers are neither Send nor Sync (because they have no safety guards).
+* `UnsafeCell` isn't Sync (and therefore `Cell` and `RefCell` aren't).
+* `Rc` isn't Send or Sync (because the refcount is shared and unsynchronized).
 
 `Rc` and `UnsafeCell` are very fundamentally not thread-safe: they enable
 unsynchronized shared mutable state. However raw pointers are, strictly
@@ -70,7 +70,7 @@ possible cause trouble by being incorrectly Send or Sync.
 Most uses of raw pointers should be encapsulated behind a sufficient abstraction
 that Send and Sync can be derived. For instance all of Rust's standard
 collections are Send and Sync (when they contain Send and Sync types) in spite
-of their pervasive use raw pointers to manage allocations and complex ownership.
+of their pervasive use of raw pointers to manage allocations and complex ownership.
 Similarly, most iterators into these collections are Send and Sync because they
 largely behave like an `&` or `&mut` into the collection.