1
Fork 0

Add #[must_use] to as_type conversions

This commit is contained in:
John Kugelman 2021-10-11 13:57:38 -04:00
parent 86d6d2b738
commit 06e625f7d5
19 changed files with 54 additions and 0 deletions

View file

@ -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);