diff options
| author | bors <bors@rust-lang.org> | 2014-08-08 03:51:15 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-08-08 03:51:15 +0000 |
| commit | aae7901a78d5804306f7b20b01622d2a423db37c (patch) | |
| tree | 5441f8447f858c9cb63ae8d65b33c5c7be8e07a7 /src/doc/tutorial.md | |
| parent | 87d2bf400ce1bc2cec832f9d5b8e763f06bb7f43 (diff) | |
| parent | 1f760d5d1a448c08ff4b66cfa8d35d39a5d667c0 (diff) | |
| download | rust-aae7901a78d5804306f7b20b01622d2a423db37c.tar.gz rust-aae7901a78d5804306f7b20b01622d2a423db37c.zip | |
auto merge of #16285 : alexcrichton/rust/rename-share, r=huonw
This leaves the `Share` trait at `std::kinds` via a `#[deprecated]` `pub use` statement, but the `NoShare` struct is no longer part of `std::kinds::marker` due to #12660 (the build cannot bootstrap otherwise). All code referencing the `Share` trait should now reference the `Sync` trait, and all code referencing the `NoShare` type should now reference the `NoSync` type. The functionality and meaning of this trait have not changed, only the naming. Closes #16281 [breaking-change]
Diffstat (limited to 'src/doc/tutorial.md')
| -rw-r--r-- | src/doc/tutorial.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/doc/tutorial.md b/src/doc/tutorial.md index fe97a2173b8..1a004e31c7d 100644 --- a/src/doc/tutorial.md +++ b/src/doc/tutorial.md @@ -2196,7 +2196,7 @@ and may not be overridden: Types are sendable unless they contain references. -* `Share` - Types that are *threadsafe*. +* `Sync` - Types that are *threadsafe*. These are types that are safe to be used across several threads with access to a `&T` pointer. `Mutex<T>` is an example of a *sharable* type with internal mutable data. @@ -2250,7 +2250,7 @@ We say that the `Printable` trait _provides_ a `print` method with the given signature. This means that we can call `print` on an argument of any type that implements the `Printable` trait. -Rust's built-in `Send` and `Share` types are examples of traits that +Rust's built-in `Send` and `Sync` types are examples of traits that don't provide any methods. Traits may be implemented for specific types with [impls]. An impl for @@ -2535,7 +2535,7 @@ select the method to call at runtime. This usage of traits is similar to Java interfaces. -There are some built-in bounds, such as `Send` and `Share`, which are properties +There are some built-in bounds, such as `Send` and `Sync`, which are properties of the components of types. By design, trait objects don't know the exact type of their contents and so the compiler cannot reason about those properties. @@ -2548,7 +2548,7 @@ trait Foo {} trait Bar<T> {} fn sendable_foo(f: Box<Foo + Send>) { /* ... */ } -fn shareable_bar<T: Share>(b: &Bar<T> + Share) { /* ... */ } +fn sync_bar<T: Sync>(b: &Bar<T> + Sync) { /* ... */ } ~~~ When no colon is specified (such as the type `Box<Foo>`), it is inferred that the |
