@@ -928,8 +928,8 @@ impl AtomicBool {
928
928
/// ```
929
929
#[ inline]
930
930
#[ unstable( feature = "atomic_mut_ptr" , reason = "recently added" , issue = "66893" ) ]
931
- pub fn as_mut_ptr ( & self ) -> * mut bool {
932
- self . v . get ( ) as * mut bool
931
+ pub const fn as_mut_ptr ( & self ) -> * mut bool {
932
+ self . v . get ( ) . cast ( )
933
933
}
934
934
935
935
/// Fetches the value, and applies a function to it that returns an optional
@@ -1803,7 +1803,7 @@ impl<T> AtomicPtr<T> {
1803
1803
///
1804
1804
/// ```ignore (extern-declaration)
1805
1805
/// #![feature(atomic_mut_ptr)]
1806
- //// use std::sync::atomic::AtomicPtr;
1806
+ /// use std::sync::atomic::AtomicPtr;
1807
1807
///
1808
1808
/// extern "C" {
1809
1809
/// fn my_atomic_op(arg: *mut *mut u32);
@@ -1819,7 +1819,7 @@ impl<T> AtomicPtr<T> {
1819
1819
/// ```
1820
1820
#[ inline]
1821
1821
#[ unstable( feature = "atomic_mut_ptr" , reason = "recently added" , issue = "66893" ) ]
1822
- pub fn as_mut_ptr ( & self ) -> * mut * mut T {
1822
+ pub const fn as_mut_ptr ( & self ) -> * mut * mut T {
1823
1823
self . p . get ( )
1824
1824
}
1825
1825
}
@@ -2727,7 +2727,7 @@ macro_rules! atomic_int {
2727
2727
#[ unstable( feature = "atomic_mut_ptr" ,
2728
2728
reason = "recently added" ,
2729
2729
issue = "66893" ) ]
2730
- pub fn as_mut_ptr( & self ) -> * mut $int_type {
2730
+ pub const fn as_mut_ptr( & self ) -> * mut $int_type {
2731
2731
self . v. get( )
2732
2732
}
2733
2733
}
0 commit comments