@@ -928,8 +928,8 @@ impl AtomicBool {
928928 /// ```
929929 #[ inline]
930930 #[ 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 ( )
933933 }
934934
935935 /// Fetches the value, and applies a function to it that returns an optional
@@ -1803,7 +1803,7 @@ impl<T> AtomicPtr<T> {
18031803 ///
18041804 /// ```ignore (extern-declaration)
18051805 /// #![feature(atomic_mut_ptr)]
1806- //// use std::sync::atomic::AtomicPtr;
1806+ /// use std::sync::atomic::AtomicPtr;
18071807 ///
18081808 /// extern "C" {
18091809 /// fn my_atomic_op(arg: *mut *mut u32);
@@ -1819,7 +1819,7 @@ impl<T> AtomicPtr<T> {
18191819 /// ```
18201820 #[ inline]
18211821 #[ 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 {
18231823 self . p . get ( )
18241824 }
18251825}
@@ -2727,7 +2727,7 @@ macro_rules! atomic_int {
27272727 #[ unstable( feature = "atomic_mut_ptr" ,
27282728 reason = "recently added" ,
27292729 issue = "66893" ) ]
2730- pub fn as_mut_ptr( & self ) -> * mut $int_type {
2730+ pub const fn as_mut_ptr( & self ) -> * mut $int_type {
27312731 self . v. get( )
27322732 }
27332733 }
0 commit comments