rust/library/core/src
Matthias Krüger c75e6f559f
Rollup merge of #103394 - Pointerbender:unsafecell-docs, r=Amanieu
Clarify documentation about the memory layout of `UnsafeCell`

This PR addresses a [comment](https://github.com/rust-lang/rust/pull/101717#issuecomment-1279908390) by `@RalfJung` in PR #101717 to further clarify the documentation of `UnsafeCell<T>`. The previous PR was merged already before we had a chance to correct this, hence this second PR :)

To goal of this PR is:

1. Split the paragraph about the memory layout of `UnsafeCell<T>` and the usage of `UnsafeCell::(raw_)get()` into two paragraphs, so that it is easier to digest for the reader.
2. Slightly simplify the previously added examples in order to reduce redundancy between the new examples and the examples that already [existed](ddd119b2fe/library/core/src/cell.rs (L1858-L1908)) before these 2 PRs (which remained untouched by both PRs).
2022-10-27 15:03:56 +02:00
..
alloc Rollup merge of #102072 - scottmcm:ptr-alignment-type, r=thomcc 2022-10-10 00:09:40 +09:00
array Rollup merge of #100462 - zohnannor:master, r=thomcc 2022-10-23 14:48:13 -07:00
async_iter Add Stream alias for AsyncIterator 2022-03-15 20:59:13 -07:00
cell Move/rename lazy::{OnceCell, Lazy} to cell::{OnceCell, LazyCell} 2022-06-16 19:53:59 +04:00
char Clarify the possible return values of len_utf16 2022-10-16 11:06:19 -04:00
convert Rollup merge of #102628 - H4x5:master, r=scottmcm 2022-10-04 06:14:12 +02:00
ffi Add is_empty() method to core::ffi::CStr. 2022-09-29 07:55:12 +09:00
fmt Auto merge of #99099 - Stargateur:phantomdata_debug, r=joshtriplett 2022-10-04 00:56:14 +00:00
future Implement Ready::into_inner() 2022-08-30 13:39:30 +02:00
hash Adjust cfgs 2022-08-12 16:28:15 -04:00
iter specialize slice_iter.copied().next_chunk() 2022-10-19 00:02:00 +02:00
macros Fix typo in concat_bytes documentation 2022-09-12 21:40:28 -04:00
mem MaybeUninit: use assume_init_drop() in the partially initialized array example 2022-10-23 19:09:18 +02:00
num Print the precondition we violated, and visible through output capture 2022-10-26 22:09:17 -04:00
ops Print the precondition we violated, and visible through output capture 2022-10-26 22:09:17 -04:00
panic Change tracking issue from #76156 to #102911 2022-10-11 06:40:37 +00:00
prelude Create 2024 edition 2022-04-02 02:45:49 -04:00
ptr Rollup merge of #103106 - saethlin:from_exposed_docs, r=thomcc 2022-10-27 09:25:09 +02:00
slice Print the precondition we violated, and visible through output capture 2022-10-26 22:09:17 -04:00
str Fix typo in ReverseSearcher docs 2022-10-17 13:14:15 -04:00
sync Remove extra spaces 2022-10-19 23:54:00 +01:00
task Added tracking issue 2022-09-19 15:07:12 +02:00
unicode Bump Unicode to version 15.0.0, regenerate tables 2022-09-14 13:21:19 -07:00
any.rs Add Provider::{would_be_satisfied_by_value_of,would_be_satisfied_by_ref_of} 2022-08-23 10:48:59 -04:00
ascii.rs Inline <EscapeDefault as Iterator>::next 2022-03-10 15:35:22 +01:00
asserting.rs [RFC 2011] Library code 2022-05-22 07:18:32 -03:00
bool.rs Add missing assertion 2022-09-22 02:12:06 -04:00
borrow.rs Add const_traits 2022-09-16 11:48:42 +08:00
cell.rs add "Memory layout" subsection to documentation of UnsafeCell for additional clarity 2022-10-27 06:32:36 +02:00
clone.rs update cfg(bootstrap)s 2022-07-01 15:48:23 +02:00
cmp.rs Add back ConstFnMutClosure::new, fix formatting 2022-09-30 17:41:01 +02:00
const_closure.rs Add back ConstFnMutClosure::new, fix formatting 2022-09-30 17:41:01 +02:00
default.rs Prevent errors for stage0 rustc build 2022-09-16 11:48:42 +08:00
error.md Move error trait into core 2022-08-22 13:28:25 -07:00
error.rs Stabilize duration_checked_float 2022-10-15 12:02:13 -07:00
hint.rs Print the precondition we violated, and visible through output capture 2022-10-26 22:09:17 -04:00
internal_macros.rs ignore a doctest for the non-exported macro 2022-05-03 18:33:56 +09:00
intrinsics.rs Print the precondition we violated, and visible through output capture 2022-10-26 22:09:17 -04:00
lib.rs Rollup merge of #103287 - saethlin:faster-len-check, r=thomcc 2022-10-26 11:29:53 +05:30
marker.rs Rollup merge of #103110 - RalfJung:manual-send, r=thomcc 2022-10-27 15:03:55 +02:00
option.rs Rollup merge of #98204 - Kixiron:stable-unzip, r=thomcc 2022-10-25 14:43:13 +05:30
panic.rs resolve the conflict in compiler/rustc_session/src/parse.rs 2022-03-16 20:12:30 +08:00
panicking.rs reorder panicking.rs to put main entry points at the top 2022-10-11 22:47:31 +02:00
pin.rs Fix the generator example for pin!() 2022-05-05 09:58:13 +10:00
primitive.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
primitive_docs.rs array docs - advertise how to get array from slice 2022-09-10 19:37:07 -07:00
result.rs Auto merge of #98354 - camsteffen:is-some-and-by-value, r=m-ou-se 2022-10-02 12:48:15 +00:00
time.rs Stabilize duration_checked_float 2022-10-15 12:02:13 -07:00
tuple.rs Added const Default impls for Arrays and Tuples. 2022-09-23 17:53:59 +02:00
unit.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00