Skip to content

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
Contributor

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
Contributor

@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
Contributor

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
Contributor

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

/// 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
Contributor

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 😄

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

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

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

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
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

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

nice catch! 😓

/// 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
Contributor

Choose a reason for hiding this comment

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

same here

/// 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
Contributor

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)

/// 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
Contributor

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
Contributor

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
Contributor

@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
Contributor

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

@bors: r+ rollup

@bors
Copy link
Collaborator

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