about summary refs log tree commit diff
path: root/src/libcore/sync
diff options
context:
space:
mode:
authorvarkor <github@varkor.com>2018-01-05 01:11:20 +0000
committervarkor <github@varkor.com>2018-01-05 01:11:20 +0000
commit4829d502cceb779468ab7f69a95223bd31a5cf46 (patch)
treeb4ec4b65bd9e6acd8851dd5887357a79ccd945cd /src/libcore/sync
parent8e7a609e635b728eba65d471c985ab462dc4cfc7 (diff)
downloadrust-4829d502cceb779468ab7f69a95223bd31a5cf46.tar.gz
rust-4829d502cceb779468ab7f69a95223bd31a5cf46.zip
Make UnsafeCell::into_inner safe
This fixes #35067. It will require a Crater run as discussed in that
issue.
Diffstat (limited to 'src/libcore/sync')
-rw-r--r--src/libcore/sync/atomic.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs
index e334d2014af..af125959f3f 100644
--- a/src/libcore/sync/atomic.rs
+++ b/src/libcore/sync/atomic.rs
@@ -285,7 +285,7 @@ impl AtomicBool {
     #[inline]
     #[stable(feature = "atomic_access", since = "1.15.0")]
     pub fn into_inner(self) -> bool {
-        unsafe { self.v.into_inner() != 0 }
+        self.v.into_inner() != 0
     }
 
     /// Loads a value from the bool.
@@ -695,7 +695,7 @@ impl<T> AtomicPtr<T> {
     #[inline]
     #[stable(feature = "atomic_access", since = "1.15.0")]
     pub fn into_inner(self) -> *mut T {
-        unsafe { self.p.into_inner() }
+        self.p.into_inner()
     }
 
     /// Loads a value from the pointer.
@@ -1050,7 +1050,7 @@ macro_rules! atomic_int {
             #[inline]
             #[$stable_access]
             pub fn into_inner(self) -> $int_type {
-                unsafe { self.v.into_inner() }
+                self.v.into_inner()
             }
 
             /// Loads a value from the atomic integer.