rust/src/libcore
Pietro Albini 54c57a2f21
Rollup merge of #65948 - danielhenrymantilla:doc/maybe_uninit_ref_mut, r=RalfJung
Improve MaybeUninit::get_{ref,mut} documentation

As mentioned in https://github.com/rust-lang/rust/issues/63568#issuecomment-544106668, `MaybeUninit`'s `get_{ref,mut}` documentation is lacking, so this PR attempts to fix that.

That being said, and as @RalfJung mentions in that thread,

> In particular, we should clarify that all the UB rules for these methods equally apply when calling the raw ptr methods and creating a reference manually.

these other docs also need to be improved, which I can do in this PR ~~(hence the `[WIP]`)~~.

Finally, since all these documentations are related to clearly establishing when dealing with uninitialized memory which patterns are known to be sound and which patterns are currently UB (that is, until, if ever, the rules around references to unintialized integers get relaxed, this documentation will treat them as UB, and advise against such patterns (_e.g._, it is not possible to use uninitialized buffers with the `Read` API)), I think that adding even more examples to the main documentation of `MaybeUninit` inherent definition wouldn't hurt either.

___

  - [Rendered](http://dreamy-ritchie-99d637.netlify.com/core/mem/union.maybeuninit#method.get_ref)
2019-11-05 14:36:55 +01:00
..
array Fill tracking issue number for array_value_iter and fix Rust version 2019-10-25 11:37:30 +02:00
benches Improve ptr_rotate performance, tests, and benchmarks 2019-08-06 10:42:48 -05:00
char Improve docs on some char boolean methods 2019-10-12 15:06:20 +02:00
fmt Apply clippy::redundant_pattern_matching suggestion 2019-10-22 19:23:10 +02:00
future Use associated_type_bounds where applicable - closes #61738 2019-08-08 22:39:15 +02:00
hash Snap cfgs to new beta 2019-09-25 08:42:46 -04:00
iter Rollup merge of #66019 - olegnn:fixed_std_iter_chain_docs, r=Mark-Simulacrum 2019-11-05 09:49:55 +01:00
mem Minor style improvements 2019-11-04 19:47:31 +01:00
num Stabilize float_to_from_bytes feature 2019-10-31 16:13:28 +00:00
ops Rollup merge of #65902 - gilescope:issue62570, r=estebank 2019-11-01 11:20:14 -07:00
prelude Move the matches! macro to the prelude 2019-10-23 15:35:36 +02:00
ptr Auto merge of #63810 - oli-obk:const_offset_from, r=RalfJung,nikic 2019-11-02 22:26:54 +00:00
slice Fix slice::as_ptr_range doctest. 2019-10-25 18:01:31 +02:00
str doc(str): show example of chars().count() under len() 2019-11-01 20:18:33 -07:00
sync Rollup merge of #65214 - Amanieu:cfg_atomic, r=alexcrichton 2019-10-13 19:17:04 +02:00
task Fix typo 2019-10-12 15:18:17 +02:00
tests Add unit tests for array::IntoIter 2019-10-24 15:46:44 +02:00
unicode it's more pythonic to use 'is not None' in python files 2019-09-06 15:14:25 +08:00
alloc.rs Fix clippy::clone_on_copy warnings 2019-07-18 15:14:56 +02:00
any.rs add example for type_name 2019-10-16 16:54:04 +00:00
ascii.rs Implement Clone, Display for ascii::EscapeDefault 2019-08-09 22:45:06 -04:00
bool.rs Snap cfgs to new beta 2019-09-25 08:42:46 -04:00
borrow.rs be more direct about borrow requirenments 2019-04-03 11:41:24 +03:00
Cargo.toml Move the matches! macro to the prelude 2019-10-23 15:35:36 +02:00
cell.rs Reorder methods of Cell 2019-10-03 15:24:00 +09:00
clone.rs Snap cfgs to new beta 2019-09-25 08:42:46 -04:00
cmp.rs Migrate from #[structural_match] attribute a lang-item trait. 2019-10-25 14:52:07 +02:00
convert.rs Rename SuperiorThanZero -> GreaterThanZero 2019-11-02 13:12:07 +00:00
default.rs Snap cfgs to new beta 2019-09-25 08:42:46 -04:00
ffi.rs doc: use new feature gate for c_void type 2019-10-29 13:01:54 +00:00
hint.rs Upgrade Emscripten targets to use upstream LLVM backend 2019-10-16 17:06:48 -07:00
internal_macros.rs std: Remove internal definitions of cfg_if! macro 2019-06-10 10:58:44 -07:00
intrinsics.rs Auto merge of #63810 - oli-obk:const_offset_from, r=RalfJung,nikic 2019-11-02 22:26:54 +00:00
iter_private.rs Remove licenses 2018-12-25 21:08:33 -07:00
lib.rs work around aggressive syntax feature gating 2019-10-30 20:59:15 +01:00
macros.rs Panicking infra uses &core::panic::Location. 2019-10-27 12:50:58 -07:00
marker.rs Migrate from #[structural_match] attribute a lang-item trait. 2019-10-25 14:52:07 +02:00
option.rs Rollup merge of #64747 - ethanboxx:master, r=Centril 2019-10-28 04:53:05 +01:00
panic.rs Panicking infra uses &core::panic::Location. 2019-10-27 12:50:58 -07:00
panicking.rs Panicking infra uses &core::panic::Location. 2019-10-27 12:50:58 -07:00
pin.rs pin.rs: fix links to primitives in documentation 2019-09-27 14:33:08 +00:00
raw.rs Fix more tests after revert of rustdoc cfg(test) feature 2019-06-09 18:15:53 +01:00
result.rs Auto merge of #63166 - ksqsf:master, r=alexcrichton 2019-09-04 07:47:08 +00:00
time.rs fix tests 2019-07-30 16:41:03 +00:00
tuple.rs libcore => 2018 2019-04-18 14:47:35 +09:00
unit.rs libcore => 2018 2019-04-18 14:47:35 +09:00