1
Fork 0

Bump stable version of arc_mutate_strong_count

This commit is contained in:
Mara Bos 2021-01-30 21:08:30 +01:00 committed by GitHub
parent a55039df84
commit fe4ac95cb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -885,7 +885,7 @@ impl<T: ?Sized> Arc<T> {
/// } /// }
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "arc_mutate_strong_count", since = "1.50.0")] #[stable(feature = "arc_mutate_strong_count", since = "1.51.0")]
pub unsafe fn increment_strong_count(ptr: *const T) { pub unsafe fn increment_strong_count(ptr: *const T) {
// Retain Arc, but don't touch refcount by wrapping in ManuallyDrop // Retain Arc, but don't touch refcount by wrapping in ManuallyDrop
let arc = unsafe { mem::ManuallyDrop::new(Arc::<T>::from_raw(ptr)) }; let arc = unsafe { mem::ManuallyDrop::new(Arc::<T>::from_raw(ptr)) };
@ -924,7 +924,7 @@ impl<T: ?Sized> Arc<T> {
/// } /// }
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "arc_mutate_strong_count", since = "1.50.0")] #[stable(feature = "arc_mutate_strong_count", since = "1.51.0")]
pub unsafe fn decrement_strong_count(ptr: *const T) { pub unsafe fn decrement_strong_count(ptr: *const T) {
unsafe { mem::drop(Arc::from_raw(ptr)) }; unsafe { mem::drop(Arc::from_raw(ptr)) };
} }