-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Closed
Commits on Jun 5, 2018
-
- 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.
Configuration menu - View commit details
-
Copy full SHA for 85f97e5 - Browse repository at this point
Copy the full SHA 85f97e5View commit details -
Mention alignment in top-level docs
This also removes the overlong link that failed tidy xD.
Configuration menu - View commit details
-
Copy full SHA for ac53367 - Browse repository at this point
Copy the full SHA ac53367View commit details -
Configuration menu - View commit details
-
Copy full SHA for eecae1d - Browse repository at this point
Copy the full SHA eecae1dView commit details -
Configuration menu - View commit details
-
Copy full SHA for de165bb - Browse repository at this point
Copy the full SHA de165bbView commit details -
Update docs for
swap_nonoverlapping
They closely mirror the docs for `copy_nonoverlapping`
Configuration menu - View commit details
-
Copy full SHA for 9e93c6b - Browse repository at this point
Copy the full SHA 9e93c6bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 29c8358 - Browse repository at this point
Copy the full SHA 29c8358View commit details -
Configuration menu - View commit details
-
Copy full SHA for 086e1e4 - Browse repository at this point
Copy the full SHA 086e1e4View commit details
Commits on Jun 15, 2018
-
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.
Configuration menu - View commit details
-
Copy full SHA for d31eb2a - Browse repository at this point
Copy the full SHA d31eb2aView commit details
Commits on Jun 16, 2018
-
Uses `x.offset(i)` must be valid for all `i` in `0..count`.
Configuration menu - View commit details
-
Copy full SHA for af2a716 - Browse repository at this point
Copy the full SHA af2a716View commit details
Commits on Jun 17, 2018
-
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".
Configuration menu - View commit details
-
Copy full SHA for 2031652 - Browse repository at this point
Copy the full SHA 2031652View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0ff407e - Browse repository at this point
Copy the full SHA 0ff407eView commit details
Commits on Jul 4, 2018
-
Add a list of known facts re: validity
Also rewrites the reads/writes section to be less reliant on `*const`, `*mut`
Configuration menu - View commit details
-
Copy full SHA for 5b6a3eb - Browse repository at this point
Copy the full SHA 5b6a3ebView commit details -
Configuration menu - View commit details
-
Copy full SHA for 46407ed - Browse repository at this point
Copy the full SHA 46407edView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.