Move A|Rc::as_ptr from feature(weak_into_raw)
to feature(rc_as_ptr) These were stabilized alongside the Weak versions, but having `feature = "weak_.."` on a fn definition for the non-weak pointers is potentially very confusing.
This commit is contained in:
parent
25687caa2e
commit
7391bf882a
2 changed files with 2 additions and 2 deletions
|
@ -1706,7 +1706,7 @@ impl<T> Weak<T> {
|
|||
/// ```
|
||||
///
|
||||
/// [`null`]: ../../std/ptr/fn.null.html
|
||||
#[stable(feature = "weak_into_raw", since = "1.45.0")]
|
||||
#[stable(feature = "rc_as_ptr", since = "1.45.0")]
|
||||
pub fn as_ptr(&self) -> *const T {
|
||||
let offset = data_offset_sized::<T>();
|
||||
let ptr = self.ptr.cast::<u8>().as_ptr().wrapping_offset(offset);
|
||||
|
|
|
@ -587,7 +587,7 @@ impl<T: ?Sized> Arc<T> {
|
|||
/// assert_eq!(x_ptr, Arc::as_ptr(&y));
|
||||
/// assert_eq!(unsafe { &*x_ptr }, "hello");
|
||||
/// ```
|
||||
#[stable(feature = "weak_into_raw", since = "1.45.0")]
|
||||
#[stable(feature = "rc_as_ptr", since = "1.45.0")]
|
||||
pub fn as_ptr(this: &Self) -> *const T {
|
||||
let ptr: *mut ArcInner<T> = NonNull::as_ptr(this.ptr);
|
||||
let fake_ptr = ptr as *mut T;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue