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

std: Improve docs for atomics. Fix two bugs #12954

Merged
merged 1 commit into from
Mar 19, 2014
Merged

Conversation

brson
Copy link
Contributor

@brson brson commented Mar 16, 2014

This adds lots of docs to the atomics module. Two of the examples
are using the future atomics API (relying on Share) and are ignored temporarily.
I discovered a bug in the way AtomicBool's fetch_nand method is
implemented and fixed it by using the correct value for true.
I also fixed the implementation of AcqRel fences (it was only doing
a release barrier), and made a "relaxed" fence a failure.

//!
//! let spinlock_clone = spinlock.clone();
//! spawn(proc() {
//! spinlock_clone.get().store(0, SeqCst);
Copy link
Member

Choose a reason for hiding this comment

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

If we're writing "ideal code", perhaps this could elide the get() because of #12900?

Copy link
Member

Choose a reason for hiding this comment

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

(similar elisions could happen in the below examples)

@alexcrichton
Copy link
Member

Nice examples! Also good catch on those two bugs

This adds lots of docs to the atomics module. Two of the examples
are using the future atomics API and are ignored temporarily.
I discovered a bug in the way AtomicBool's fetch_nand method is
implemented and fixed it by using the correct value for `true`.
I also fixed the implementation of AcqRel fences (it was only doing
a release barrier), and made a "relaxed" fence a failure.
@brson
Copy link
Contributor Author

brson commented Mar 18, 2014

All points addressed.

bors added a commit that referenced this pull request Mar 19, 2014
This adds lots of docs to the atomics module. Two of the examples
are using the future atomics API (relying on `Share`) and are ignored temporarily.
I discovered a bug in the way AtomicBool's fetch_nand method is
implemented and fixed it by using the correct value for `true`.
I also fixed the implementation of AcqRel fences (it was only doing
a release barrier), and made a "relaxed" fence a failure.
@bors bors closed this Mar 19, 2014
@bors bors merged commit 749e527 into rust-lang:master Mar 19, 2014
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jul 25, 2024
…cientific notation

fixes: rust-lang#12954

changelog: fix [`excessive_precision`] suggestions on float literal written in scientific notation
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jul 25, 2024
fix [`excessive_precision`] suggestions on floats written in scientific notation

fixes rust-lang#12954

changelog: fix [`excessive_precision`] suggestions on float literal written in scientific notation
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