Rollup merge of #89778 - jkugelman:must-use-as_type-conversions, r=joshtriplett
Add #[must_use] to as_type conversions Clippy missed these: ```rust alloc::string::String fn as_mut_str(&mut self) -> &mut str; core::mem::NonNull<T> unsafe fn as_uninit_mut<'a>(&mut self) -> &'a MaybeUninit<T>; str unsafe fn as_bytes_mut(&mut self) -> &mut [u8]; str fn as_mut_ptr(&mut self) -> *mut u8; ``` Parent issue: #89692 r? ````@joshtriplett````
This commit is contained in:
commit
b55a3c5d15
19 changed files with 54 additions and 0 deletions
|
@ -2093,6 +2093,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