Add #[must_use] to as_type conversions
This commit is contained in:
parent
86d6d2b738
commit
06e625f7d5
19 changed files with 54 additions and 0 deletions
|
@ -2087,6 +2087,7 @@ impl<T: ?Sized> Weak<T> {
|
|||
/// ```
|
||||
///
|
||||
/// [`null`]: ptr::null
|
||||
#[must_use]
|
||||
#[stable(feature = "rc_as_ptr", since = "1.45.0")]
|
||||
pub fn as_ptr(&self) -> *const T {
|
||||
let ptr: *mut RcBox<T> = NonNull::as_ptr(self.ptr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue