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
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
911d35f
Rewrite docs for `std::ptr`
ecstatic-morse Apr 6, 2018
da58beb
Mention alignment in top-level docs
May 24, 2018
9f5a3cc
Fix failing doctests
ecstatic-morse May 24, 2018
04a08c6
Fix unused variable warning in doctest
ecstatic-morse May 24, 2018
7b2ef6b
Update docs for `swap_nonoverlapping`
ecstatic-morse May 29, 2018
6f7338b
Reword module level docs re: alignment
ecstatic-morse Jun 5, 2018
30122e9
Fix off-by-one error when specifying a valid range
ecstatic-morse Jun 5, 2018
e40585f
Remove definiton of valid pointer
ecstatic-morse Jun 15, 2018
ea5570c
Redefine range validity
ecstatic-morse Jun 16, 2018
3a55c85
Incorporate RalfJung's suggestions
ecstatic-morse Jun 17, 2018
95a9088
You can't make an omlette without breaking a few links
ecstatic-morse Jun 17, 2018
7e165d9
Add a list of known facts re: validity
ecstatic-morse Jul 4, 2018
c8da321
Resolve null/ZST conflict correctly (whoops)
ecstatic-morse Jul 4, 2018
b0c5dc2
edit docs a little
RalfJung Aug 29, 2018
098bec8
clarify that these are preliminary guarantees
RalfJung Aug 29, 2018
fc63113
clarify ZST comment
RalfJung Aug 30, 2018
1ec66fb
apply comments
RalfJung Aug 30, 2018
e869b81
address remaining remarks and add example for dropping unaligned data
RalfJung Aug 30, 2018
d97f61f
avoid shadowing; fix examples
RalfJung Aug 30, 2018
c06f551
improve volatile comments
RalfJung Aug 30, 2018
2741224
fix example
RalfJung Aug 30, 2018
18a7bdb
fix example
RalfJung Aug 30, 2018
4ed469c
turn ptr type method docs into links to docs of free functions, to av…
RalfJung Aug 31, 2018
dc2237c
apply feedback
RalfJung Aug 31, 2018
b463871
(un)aligned
RalfJung Aug 31, 2018
408a6a0
fix doctests
RalfJung Aug 31, 2018
755de3c
Valid raw pointers
RalfJung Sep 1, 2018
bc809e0
remark on concurrency in validity section
RalfJung Sep 1, 2018
78f5b68
fix typos
ubsan Sep 11, 2018
c44e88c
Merge pull request #1 from ubsan/ptr-docs
RalfJung Sep 11, 2018
2713d36
tweaks
RalfJung Sep 17, 2018
0ec87d0
rearrange for clarity
RalfJung Sep 17, 2018
adcc0d2
clarify swap
RalfJung Sep 18, 2018
c197dc4
clarify write_bytes a bit
RalfJung Sep 21, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/libcore/ptr.rs
Original file line number Diff line number Diff line change
@@ -42,10 +42,9 @@
//!
//! * The result of casting a reference to a pointer is valid for as long as the
//! underlying object is live.
//! * All pointers to types with a [size of zero][zst] are valid for all
//! operations of size zero.
//! * A [null] pointer is *never* valid, except when it points to a zero-sized
//! type.
//! * A [null] pointer is *never* valid.
//! * All pointers (except for the null pointer) are valid for all operations of
//! [size zero][zst].
//!
//! These axioms, along with careful use of [`offset`] for pointer arithmentic,
//! are enough to correctly implement many useful things in unsafe code. Still,