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 std::ptr (Take #2) #51016

Closed
wants to merge 13 commits into from

Commits on Jun 5, 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 committed Jun 5, 2018
    Configuration menu
    Copy the full SHA
    85f97e5 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 ecstatic-morse committed Jun 5, 2018
    Configuration menu
    Copy the full SHA
    ac53367 View commit details
    Browse the repository at this point in the history
  3. Fix failing doctests

    ecstatic-morse committed Jun 5, 2018
    Configuration menu
    Copy the full SHA
    eecae1d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    de165bb 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 committed Jun 5, 2018
    Configuration menu
    Copy the full SHA
    9e93c6b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    29c8358 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    086e1e4 View commit details
    Browse the repository at this point in the history

Commits on Jun 15, 2018

  1. 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 committed Jun 15, 2018
    Configuration menu
    Copy the full SHA
    d31eb2a View commit details
    Browse the repository at this point in the history

Commits on Jun 16, 2018

  1. Redefine range validity

    Uses `x.offset(i)` must be valid for all `i` in `0..count`.
    ecstatic-morse committed Jun 16, 2018
    Configuration menu
    Copy the full SHA
    af2a716 View commit details
    Browse the repository at this point in the history

Commits on Jun 17, 2018

  1. 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 committed Jun 17, 2018
    Configuration menu
    Copy the full SHA
    2031652 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0ff407e View commit details
    Browse the repository at this point in the history

Commits on Jul 4, 2018

  1. Add a list of known facts re: validity

    Also rewrites the reads/writes section to be less reliant on `*const`,
    `*mut`
    ecstatic-morse committed Jul 4, 2018
    Configuration menu
    Copy the full SHA
    5b6a3eb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    46407ed View commit details
    Browse the repository at this point in the history