Rollup merge of #104024 - noeddl:unused-must-use, r=compiler-errors
Fix `unused_must_use` warning for `Box::from_raw`
This commit is contained in:
commit
58233e90b8
@ -954,7 +954,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) }
|
||||
}
|
||||
|
@ -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
|
||||
|
|
||||
|
Loading…
Reference in New Issue
Block a user