about summary refs log tree commit diff
path: root/library/alloc/src/rc.rs
diff options
context:
space:
mode:
authorJohn Kugelman <john@kugelman.name>2021-10-11 13:57:38 -0400
committerJohn Kugelman <john@kugelman.name>2021-10-11 13:57:38 -0400
commit06e625f7d582601f5e2ff69ba80f6d3a11632b24 (patch)
treed2b9b88fb89cf0f074feeaa191cb9e22a4a9eee5 /library/alloc/src/rc.rs
parent86d6d2b7389fe1b339402c1798edae8b695fc9ef (diff)
downloadrust-06e625f7d582601f5e2ff69ba80f6d3a11632b24.tar.gz
rust-06e625f7d582601f5e2ff69ba80f6d3a11632b24.zip
Add #[must_use] to as_type conversions
Diffstat (limited to 'library/alloc/src/rc.rs')
-rw-r--r--library/alloc/src/rc.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs
index c6573597b1e..c337b7c5a59 100644
--- a/library/alloc/src/rc.rs
+++ b/library/alloc/src/rc.rs
@@ -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);