diff options
| author | bors <bors@rust-lang.org> | 2023-05-01 20:35:53 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-05-01 20:35:53 +0000 |
| commit | d6ddee637b62c6c4cdee90d98c3a21a1325a8e81 (patch) | |
| tree | 4be608ba309b622a1f66a912b261179c1595a291 /library/core/src | |
| parent | dbba594575ce75b1b57ccb1e4223b9909a28b1b8 (diff) | |
| parent | 15eebac9d962fa7510f4729f85e57c46a39c3ea1 (diff) | |
| download | rust-d6ddee637b62c6c4cdee90d98c3a21a1325a8e81.tar.gz rust-d6ddee637b62c6c4cdee90d98c3a21a1325a8e81.zip | |
Auto merge of #111066 - matthiaskrgr:rollup-4k6rj23, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #109540 (std docs: edit `PathBuf::set_file_name` example) - #110093 (Add 64-bit `time_t` support on 32-bit glibc Linux to `set_times`) - #110987 (update wasi_clock_time_api ref.) - #111038 (Leave promoteds untainted by errors when borrowck fails) - #111042 (Add `#[no_coverage]` to the test harness's `fn main`) - #111057 (Make sure the implementation of TcpStream::as_raw_fd is fully inlined) - #111065 (Explicitly document how Send and Sync relate to references) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/core/src')
| -rw-r--r-- | library/core/src/marker.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs index 40789cb3049..82e4c648974 100644 --- a/library/core/src/marker.rs +++ b/library/core/src/marker.rs @@ -24,7 +24,7 @@ use crate::hash::Hasher; /// operations. Its cousin [`sync::Arc`][arc] does use atomic operations (incurring /// some overhead) and thus is `Send`. /// -/// See [the Nomicon](../../nomicon/send-and-sync.html) for more details. +/// See [the Nomicon](../../nomicon/send-and-sync.html) and the [`Sync`] trait for more details. /// /// [`Rc`]: ../../std/rc/struct.Rc.html /// [arc]: ../../std/sync/struct.Arc.html @@ -426,6 +426,11 @@ pub macro Copy($item:item) { /// becomes read-only, as if it were a `& &T`. Hence there is no risk /// of a data race. /// +/// A shorter overview of how [`Sync`] and [`Send`] relate to referencing: +/// * `&T` is [`Send`] if and only if `T` is [`Sync`] +/// * `&mut T` is [`Send`] if and only if `T` is [`Send`] +/// * `&T` and `&mut T` are [`Sync`] if and only if `T` is [`Sync`] +/// /// Types that are not `Sync` are those that have "interior /// mutability" in a non-thread-safe form, such as [`Cell`][cell] /// and [`RefCell`][refcell]. These types allow for mutation of |
