Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite docs for pointer methods #53783

Merged
merged 34 commits into from
Sep 24, 2018
Merged

Rewrite docs for pointer methods #53783

merged 34 commits into from
Sep 24, 2018

Commits on Aug 29, 2018

  1. 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.
    ecstatic-morse authored and RalfJung committed Aug 29, 2018
    Configuration menu
    Copy the full SHA
    911d35f View commit details
    Browse the repository at this point in the history
  2. Mention alignment in top-level docs

    This also removes the overlong link that failed tidy xD.
    Dylan MacKenzie authored and RalfJung committed Aug 29, 2018
    Configuration menu
    Copy the full SHA
    da58beb View commit details
    Browse the repository at this point in the history
  3. Fix failing doctests

    ecstatic-morse authored and RalfJung committed Aug 29, 2018
    Configuration menu
    Copy the full SHA
    9f5a3cc View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    04a08c6 View commit details
    Browse the repository at this point in the history
  5. Update docs for swap_nonoverlapping

    They closely mirror the docs for `copy_nonoverlapping`
    ecstatic-morse authored and RalfJung committed Aug 29, 2018
    Configuration menu
    Copy the full SHA
    7b2ef6b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    6f7338b View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    30122e9 View commit details
    Browse the repository at this point in the history
  8. Remove definiton of valid pointer

    The enumerated list of conditions is replaced by an explanation that
    rust doesn't have a formal memory model. It does say that pointers
    created directly from references are guaranteed to be valid, and links
    to both the "Unsafe Code" section of the book and the "Undefined
    Behavior" section of the reference.
    ecstatic-morse authored and RalfJung committed Aug 29, 2018
    Configuration menu
    Copy the full SHA
    e40585f View commit details
    Browse the repository at this point in the history
  9. Redefine range validity

    Uses `x.offset(i)` must be valid for all `i` in `0..count`.
    ecstatic-morse authored and RalfJung committed Aug 29, 2018
    Configuration menu
    Copy the full SHA
    ea5570c View commit details
    Browse the repository at this point in the history
  10. Incorporate RalfJung's suggestions

    This splits "valid" into "valid for reads" and "valid for writes", and
    also adds the concept of operation size to validity. Now functions which
    operate on sequences state that e.g. pointer args must be "valid for reads of
    size x".
    ecstatic-morse authored and RalfJung committed Aug 29, 2018
    Configuration menu
    Copy the full SHA
    3a55c85 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    95a9088 View commit details
    Browse the repository at this point in the history
  12. Add a list of known facts re: validity

    Also rewrites the reads/writes section to be less reliant on `*const`,
    `*mut`
    ecstatic-morse authored and RalfJung committed Aug 29, 2018
    Configuration menu
    Copy the full SHA
    7e165d9 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    c8da321 View commit details
    Browse the repository at this point in the history
  14. edit docs a little

    RalfJung committed Aug 29, 2018
    Configuration menu
    Copy the full SHA
    b0c5dc2 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    098bec8 View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2018

  1. clarify ZST comment

    RalfJung committed Aug 30, 2018
    Configuration menu
    Copy the full SHA
    fc63113 View commit details
    Browse the repository at this point in the history
  2. apply comments

    RalfJung committed Aug 30, 2018
    Configuration menu
    Copy the full SHA
    1ec66fb View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e869b81 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d97f61f View commit details
    Browse the repository at this point in the history
  5. improve volatile comments

    RalfJung committed Aug 30, 2018
    Configuration menu
    Copy the full SHA
    c06f551 View commit details
    Browse the repository at this point in the history
  6. fix example

    RalfJung committed Aug 30, 2018
    1 Configuration menu
    Copy the full SHA
    2741224 View commit details
    Browse the repository at this point in the history
  7. fix example

    RalfJung committed Aug 30, 2018
    Configuration menu
    Copy the full SHA
    18a7bdb View commit details
    Browse the repository at this point in the history

Commits on Aug 31, 2018

  1. turn ptr type method docs into links to docs of free functions, to av…

    …oid duplication and inconsistency
    RalfJung committed Aug 31, 2018
    Configuration menu
    Copy the full SHA
    4ed469c View commit details
    Browse the repository at this point in the history
  2. apply feedback

    RalfJung committed Aug 31, 2018
    Configuration menu
    Copy the full SHA
    dc2237c View commit details
    Browse the repository at this point in the history
  3. (un)aligned

    RalfJung committed Aug 31, 2018
    Configuration menu
    Copy the full SHA
    b463871 View commit details
    Browse the repository at this point in the history
  4. fix doctests

    RalfJung committed Aug 31, 2018
    Configuration menu
    Copy the full SHA
    408a6a0 View commit details
    Browse the repository at this point in the history

Commits on Sep 1, 2018

  1. Valid raw pointers

    RalfJung committed Sep 1, 2018
    Configuration menu
    Copy the full SHA
    755de3c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bc809e0 View commit details
    Browse the repository at this point in the history

Commits on Sep 11, 2018

  1. fix typos

    ubsan committed Sep 11, 2018
    Configuration menu
    Copy the full SHA
    78f5b68 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1 from ubsan/ptr-docs

    fix typos
    RalfJung committed Sep 11, 2018
    Configuration menu
    Copy the full SHA
    c44e88c View commit details
    Browse the repository at this point in the history

Commits on Sep 17, 2018

  1. tweaks

    RalfJung committed Sep 17, 2018
    Configuration menu
    Copy the full SHA
    2713d36 View commit details
    Browse the repository at this point in the history
  2. rearrange for clarity

    RalfJung committed Sep 17, 2018
    Configuration menu
    Copy the full SHA
    0ec87d0 View commit details
    Browse the repository at this point in the history

Commits on Sep 18, 2018

  1. clarify swap

    RalfJung committed Sep 18, 2018
    Configuration menu
    Copy the full SHA
    adcc0d2 View commit details
    Browse the repository at this point in the history

Commits on Sep 21, 2018

  1. clarify write_bytes a bit

    RalfJung committed Sep 21, 2018
    Configuration menu
    Copy the full SHA
    c197dc4 View commit details
    Browse the repository at this point in the history