1
Fork 0

Add #[must_use] to conversions that move self

This commit is contained in:
John Kugelman 2021-10-10 19:50:52 -04:00
parent 6928fafe06
commit b115781bcd
19 changed files with 54 additions and 11 deletions

View file

@ -2130,6 +2130,7 @@ impl<T: ?Sized> Weak<T> {
///
/// [`from_raw`]: Weak::from_raw
/// [`as_ptr`]: Weak::as_ptr
#[must_use = "`self` will be dropped if the result is not used"]
#[stable(feature = "weak_into_raw", since = "1.45.0")]
pub fn into_raw(self) -> *const T {
let result = self.as_ptr();