Skip to content

impl From<T> for AtomicT #45610

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

Merged
merged 3 commits into from
Nov 4, 2017
Merged
Changes from 1 commit
Commits
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
Next Next commit
impl From<T> for AtomicT
  • Loading branch information
strake committed Oct 29, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 5c21637f9ab8f062f63d300507aa3eb7fdde0064
12 changes: 12 additions & 0 deletions src/libcore/sync/atomic.rs
Original file line number Diff line number Diff line change
@@ -927,6 +927,12 @@ impl<T> AtomicPtr<T> {
}
}

#[stable(feature = "rust1", since = "1.0.0")]
Copy link
Member

Choose a reason for hiding this comment

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

This is wrong as it implies the implementation has existed since 1.0.0. You need to make a new stable feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh, that makes sense now — it complained about (feature = "rust1", since = "1.22.0").

impl<T> From<*mut T> for AtomicPtr<T> {
#[inline]
fn from(p: *mut T) -> Self { Self::new(p) }
}

#[cfg(target_has_atomic = "ptr")]
macro_rules! atomic_int {
($stable:meta, $const_unstable:meta,
@@ -967,6 +973,12 @@ macro_rules! atomic_int {
}
}

#[$stable]
Copy link
Member

Choose a reason for hiding this comment

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

Similarly here.

impl From<$int_type> for $atomic_type {
#[inline]
fn from(v: $int_type) -> Self { Self::new(v) }
}

#[$stable_debug]
impl fmt::Debug for $atomic_type {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {