-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Adding links for Atomics docs #29377 #40871
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
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @steveklabnik (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much! I have some small nits to make the formatting fall in line with some of our conventions, and one bugfix. 🎊
src/libcore/sync/atomic.rs
Outdated
//! atomically-reference-counted shared pointer). | ||
//! | ||
//! [`Sync`]: ../../marker/trait.Sync.html | ||
//! [arc]: ../struct.Arc.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://travis-ci.org/rust-lang/rust/jobs/215789767#L8942 (It says this link is broken.)
The reason for this is that these docs also get rendered for libcore
, not just libstd
. So can you change it to ../../../std/sync/struct.Arc.html
? Tricky!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I had some issues with this one. I wasn't sure if a longer path was better for this to get linked in both place correctly. I'll play around it some more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now it is, yeah. Someday...
src/libcore/sync/atomic.rs
Outdated
/// No ordering constraints, only atomic operations. Corresponds to LLVM's | ||
/// `Monotonic` ordering. | ||
/// [`Monotonic`][1] ordering. | ||
/// [1]: http://llvm.org/docs/Atomics.html#monotonic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you're here, would you mind helping with a minor formatting issue as well? This should look like this:
/// No ordering constraints, only atomic operations.
///
/// Corresponds to LLVM's [`Monotonic`] ordering.
///
/// [`Monotonic`]: http://llvm.org/docs/Atomics.html#monotonic
Thanks 😄
src/libcore/sync/atomic.rs
Outdated
/// to the other threads that perform a load with `Acquire` ordering | ||
/// to the other threads that perform a load with [`Acquire`][1] ordering | ||
/// on the same value. | ||
/// [1]: http://llvm.org/docs/Atomics.html#acquire |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar here, could this be
/// to the other threads that perform a load with [`Acquire`] ordering
/// on the same value.
///
/// [`Aquire`]: http://llvm.org/docs/Atomics.html#acquire
src/libcore/sync/atomic.rs
Outdated
/// written before a store with `Release` ordering on the same value | ||
/// written before a store with [`Release`][1] ordering on the same value | ||
/// in other threads. | ||
/// [1]: http://llvm.org/docs/Atomics.html#release |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
src/libcore/sync/atomic.rs
Outdated
/// When coupled with a load, uses [`Acquire`][1] ordering, and with a store | ||
/// [`Release`][2] ordering. | ||
/// [1]: http://llvm.org/docs/Atomics.html#acquire | ||
/// [2]: http://llvm.org/docs/Atomics.html#release |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here:
/// When coupled with a load, uses [`Acquire`] ordering, and with a store
/// [`Release`] ordering.
///
/// [`Acquire`]: http://llvm.org/docs/Atomics.html#acquire
/// [`Release`]: http://llvm.org/docs/Atomics.html#release
/// [`Ordering`]: enum.Ordering.html | ||
/// [`Release`]: enum.Ordering.html#variant.Release | ||
/// [`AcqRel`]: enum.Ordering.html#variant.Release | ||
/// [`AcqRel`]: enum.Ordering.html#variant.AcqRel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch! 😓
src/libcore/sync/atomic.rs
Outdated
/// Stores a value into the bool, returning the old value. | ||
/// | ||
/// `swap` takes an [`Ordering`] argument which describes the memory ordering | ||
/// `swap()` takes an [`Ordering`] argument which describes the memory ordering |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
src/libcore/sync/atomic.rs
Outdated
/// was updated. | ||
/// | ||
/// `compare_and_swap` also takes an [`Ordering`] argument which describes the memory | ||
/// `compare_and_swap()` also takes an [`Ordering`] argument which describes the memory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here (I'll stop now, but all the others too)
src/libcore/sync/atomic.rs
Outdated
/// failure ordering can't be [`Release`] or [`AcqRel`] and must be equivalent or | ||
/// weaker than the success ordering. | ||
/// | ||
/// [`compare_exchange()`]: #method.compare_exchange |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when removing the ()
s this one will have to go too
src/libcore/sync/atomic.rs
Outdated
/// | ||
/// [`Acquire`]: enum.Ordering.html#variant.Acquire | ||
/// [`AcqRel`]: enum.Ordering.html#variant.AcqRel | ||
/// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you remove this extra line please?
@steveklabnik I've pushed a new commit for the formatting changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bors: r+ rollup
thanks so much!
📌 Commit 4ea03c8 has been approved by |
Adding links for Atomics docs rust-lang#29377 r? @steveklabnik This should be good for `std::sync::atomic`. The other pages still need more (examples, etc.).
Adding links for Atomics docs rust-lang#29377 r? @steveklabnik This should be good for `std::sync::atomic`. The other pages still need more (examples, etc.).
r? @steveklabnik
This should be good for
std::sync::atomic
. The other pages still need more (examples, etc.).