diff options
| author | Pietro Albini <pietro@pietroalbini.org> | 2019-11-05 14:36:55 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-05 14:36:55 +0100 |
| commit | 54c57a2f21193b8a3a6ec1ffd641931bd6da246c (patch) | |
| tree | 74ba8f2fcc8e79911ab2ef06cf26d734d31400fa /src/libsyntax/parse | |
| parent | d1fff4a4b213b3341c1ff994061b7965a5932c70 (diff) | |
| parent | 67f2200f4a1836742a605dca551408db56976b69 (diff) | |
| download | rust-54c57a2f21193b8a3a6ec1ffd641931bd6da246c.tar.gz rust-54c57a2f21193b8a3a6ec1ffd641931bd6da246c.zip | |
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)
Diffstat (limited to 'src/libsyntax/parse')
0 files changed, 0 insertions, 0 deletions
