]> git.lizzy.rs Git - rust.git/commit
Rewrite docs for `std::ptr`
authorDylan MacKenzie <ecstaticmorse@gmail.com>
Fri, 6 Apr 2018 07:34:45 +0000 (00:34 -0700)
committerRalf Jung <post@ralfj.de>
Wed, 29 Aug 2018 08:10:58 +0000 (10:10 +0200)
commit911d35f0bfd207112806eaec2763201dad06d1c7
treec9a97932703a7bb1e6b2886c8e7f428d9a03df7d
parent29e6aabcebe3bdb507df22a6233024711412b343
Rewrite docs for `std::ptr`

- Add links to the GNU libc docs for `memmove`, `memcpy`, and
  `memset`, as well as internally linking to other functions in `std::ptr`
- List invariants which, when violated, cause UB for all functions
- Add example to `ptr::drop_in_place` and compares it to `ptr::read`.
- Add examples which more closely mirror real world uses for the
  functions in `std::ptr`. Also, move the reimplementation of `mem::swap`
  to the examples of `ptr::read` and use a more interesting example for
  `copy_nonoverlapping`.
- Change module level description
- Define what constitutes a "valid" pointer.
- Centralize discussion of ownership of bitwise copies in `ptr::read` and
  provide an example.
src/libcore/intrinsics.rs
src/libcore/ptr.rs