about summary refs log tree commit diff
path: root/src/libcore/sync
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-01-28 19:01:51 +0000
committerbors <bors@rust-lang.org>2018-01-28 19:01:51 +0000
commit21882aad7299e8e859785845ac12374990f24dae (patch)
tree9ab0ec27b9832d7ed017afa31e772a0616cfd796 /src/libcore/sync
parent771873c84137842c78cfc39625613b95867d21ef (diff)
parent4829d502cceb779468ab7f69a95223bd31a5cf46 (diff)
downloadrust-21882aad7299e8e859785845ac12374990f24dae.tar.gz
rust-21882aad7299e8e859785845ac12374990f24dae.zip
Auto merge of #47204 - varkor:unsafecell-into_inner-safe, r=alexcrichton
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 3da9e9c87dd..8b47143f63c 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.
@@ -1051,7 +1051,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.