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

Adding links for Atomics docs #29377 #40871

Merged
merged 2 commits into from
Apr 1, 2017
Merged

Adding links for Atomics docs #29377 #40871

merged 2 commits into from
Apr 1, 2017

Conversation

projektir
Copy link
Contributor

@projektir projektir commented Mar 28, 2017

r? @steveklabnik

This should be good for std::sync::atomic. The other pages still need more (examples, etc.).

@rust-highfive
Copy link
Collaborator

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.

Copy link
Member

@steveklabnik steveklabnik left a 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. 🎊

//! atomically-reference-counted shared pointer).
//!
//! [`Sync`]: ../../marker/trait.Sync.html
//! [arc]: ../struct.Arc.html
Copy link
Member

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!

Copy link
Contributor Author

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.

Copy link
Member

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...

@@ -149,21 +159,26 @@ unsafe impl<T> Sync for AtomicPtr<T> {}
#[derive(Copy, Clone, Debug)]
pub enum Ordering {
/// No ordering constraints, only atomic operations. Corresponds to LLVM's
/// `Monotonic` ordering.
/// [`Monotonic`][1] ordering.
/// [1]: http://llvm.org/docs/Atomics.html#monotonic
Copy link
Member

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 😄

/// on the same value.
/// [1]: http://llvm.org/docs/Atomics.html#acquire
Copy link
Member

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

/// in other threads.
/// [1]: http://llvm.org/docs/Atomics.html#release
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

/// 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
Copy link
Member

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

@@ -250,7 +266,7 @@ impl AtomicBool {
///
/// [`Ordering`]: enum.Ordering.html
/// [`Release`]: enum.Ordering.html#variant.Release
/// [`AcqRel`]: enum.Ordering.html#variant.Release
/// [`AcqRel`]: enum.Ordering.html#variant.AcqRel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch! 😓

@@ -298,7 +317,7 @@ impl AtomicBool {

/// 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@@ -324,7 +343,7 @@ impl AtomicBool {
/// The return value is always the previous value. If it is equal to `current`, then the value
/// 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
Copy link
Member

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)

/// ordering of this operation. The first describes the required ordering if the operation
/// succeeds while the second describes the required ordering when the operation fails. The
/// failure ordering can't be [`Release`] or [`AcqRel`] and must be equivalent or
/// weaker than the success ordering.
///
/// [`compare_exchange()`]: #method.compare_exchange
Copy link
Member

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

///
/// [`Acquire`]: enum.Ordering.html#variant.Acquire
/// [`AcqRel`]: enum.Ordering.html#variant.AcqRel
///
Copy link
Member

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?

@projektir
Copy link
Contributor Author

@steveklabnik I've pushed a new commit for the formatting changes.

Copy link
Member

@steveklabnik steveklabnik left a 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!

@steveklabnik
Copy link
Member

Oops, looks like @bors doesn't see review comments.

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Mar 31, 2017

📌 Commit 4ea03c8 has been approved by steveklabnik

frewsxcv added a commit to frewsxcv/rust that referenced this pull request Mar 31, 2017
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.).
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Mar 31, 2017
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.).
bors added a commit that referenced this pull request Mar 31, 2017
Rollup of 6 pull requests

- Successful merges: #40703, #40728, #40763, #40871, #40935, #40947
- Failed merges:
@bors bors merged commit 4ea03c8 into rust-lang:master Apr 1, 2017
@projektir projektir deleted the atomic_links branch April 1, 2017 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants