about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAnett Seeker <noeddl@users.noreply.github.com>2022-11-05 21:52:18 +0100
committerAnett Seeker <noeddl@users.noreply.github.com>2022-11-05 21:52:18 +0100
commit3b8b0ac62ad2a8f828763350a37dfd5e14db171e (patch)
tree7bc65c24e4cf31086e1423220a23e3e6f6884ee8
parent6b8d9dd0a09851b3e4f400ddd1303857945be25d (diff)
downloadrust-3b8b0ac62ad2a8f828763350a37dfd5e14db171e.tar.gz
rust-3b8b0ac62ad2a8f828763350a37dfd5e14db171e.zip
Fix unused_must_use warning for Box::from_raw
-rw-r--r--library/alloc/src/boxed.rs2
-rw-r--r--src/test/ui/lint/unused/must-use-box-from-raw.stderr2
2 files changed, 2 insertions, 2 deletions
diff --git a/library/alloc/src/boxed.rs b/library/alloc/src/boxed.rs
index b7e7d5a38a5..f73df698f16 100644
--- a/library/alloc/src/boxed.rs
+++ b/library/alloc/src/boxed.rs
@@ -952,7 +952,7 @@ impl<T: ?Sized> Box<T> {
     /// [`Layout`]: crate::Layout
     #[stable(feature = "box_raw", since = "1.4.0")]
     #[inline]
-    #[must_use = "call `drop(from_raw(ptr))` if you intend to drop the `Box`"]
+    #[must_use = "call `drop(Box::from_raw(ptr))` if you intend to drop the `Box`"]
     pub unsafe fn from_raw(raw: *mut T) -> Self {
         unsafe { Self::from_raw_in(raw, Global) }
     }
diff --git a/src/test/ui/lint/unused/must-use-box-from-raw.stderr b/src/test/ui/lint/unused/must-use-box-from-raw.stderr
index 011acc3bf5d..fcf32b75d8d 100644
--- a/src/test/ui/lint/unused/must-use-box-from-raw.stderr
+++ b/src/test/ui/lint/unused/must-use-box-from-raw.stderr
@@ -4,7 +4,7 @@ warning: unused return value of `Box::<T>::from_raw` that must be used
 LL |     Box::from_raw(ptr);
    |     ^^^^^^^^^^^^^^^^^^^
    |
-   = note: call `drop(from_raw(ptr))` if you intend to drop the `Box`
+   = note: call `drop(Box::from_raw(ptr))` if you intend to drop the `Box`
 note: the lint level is defined here
   --> $DIR/must-use-box-from-raw.rs:5:9
    |