From 261da5fc4b2f015436a206f217300f6616628052 Mon Sep 17 00:00:00 2001 From: Zachary S Date: Sun, 18 Feb 2024 22:43:42 -0600 Subject: Clarify/add `must_use` message for Rc/Arc/Weak::into_raw. --- library/alloc/src/sync.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'library/alloc/src/sync.rs') diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index e1211da4c61..c7c38d9b45e 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -2715,7 +2715,7 @@ impl Weak { /// /// [`from_raw`]: Weak::from_raw /// [`as_ptr`]: Weak::as_ptr - #[must_use = "`self` will be dropped if the result is not used"] + #[must_use = "losing the pointer will leak memory"] #[stable(feature = "weak_into_raw", since = "1.45.0")] pub fn into_raw(self) -> *const T { let result = self.as_ptr(); -- cgit 1.4.1-3-g733a5