Lines Matching defs:leak
7621 // clean up the leak to keep miri happy
15821 // hopefully we don't double-free (or leak)...
19642 //! a memory leak. In order to get around this, we can use [`Weak`]
19843 Box::leak(box RcBox { strong: Cell::new(1), weak: Cell::new(1), value }).into(),
19875 let uninit_ptr: NonNull<_> = Box::leak(box RcBox {
19992 Box::leak(Box::try_new(RcBox { strong: Cell::new(1), weak: Cell::new(1), value })?)
20258 /// To avoid a memory leak the pointer must be converted back to an `Rc` using
20333 /// // Convert back to an `Rc` to prevent leak.
23607 Self::from_inner(Box::leak(x).into())
23635 let uninit_ptr: NonNull<_> = Box::leak(box ArcInner {
23774 Ok(Self::from_inner(Box::leak(x).into()))
24031 /// To avoid a memory leak the pointer must be converted back to an `Arc` using
24104 /// // Convert back to an `Arc` to prevent leak.
26447 // hopefully we don't double-free (or leak)...
27084 let node = Some(Box::leak(node).into());
27125 let node = Some(Box::leak(node).into());
28317 let spliced_node = Box::leak(Box::new(Node::new(item))).into();
28337 let spliced_node = Box::leak(Box::new(Node::new(item))).into();
29194 /// easier for the caller to avoid a leak when a drop handler panicks.
29217 /// caller to avoid a leak when the iterator panicks.
38142 NodeRef { height: 0, node: NonNull::from(Box::leak(leaf)), _marker: PhantomData }
38157 let node = NonNull::from(Box::leak(internal)).cast();
46736 // if the drop panics then we also leak any elements collected into dst_buf
48024 /// While the following example is sound, there is a memory leak since
48040 /// the contents and thus not leak memory.
48720 /// This function is similar to the [`leak`][Box::leak] function on [`Box`]
48725 /// leak.
48733 /// let static_ref: &'static mut [usize] = x.leak();
48739 pub fn leak<'a>(self) -> &'a mut [T]
48743 Box::leak(self.into_boxed_slice())
49415 // Guard against us getting leaked (leak amplification)
51085 reason = "use `Box::leak(b).into()` or `Unique::from(Box::leak(b))` instead"
51093 // so all raw pointer methods have to go through `Box::leak`. Turning *that* to a raw pointer
51096 (Unique::from(Box::leak(b)), alloc)
51117 /// leak. If this is not acceptable, the reference should first be wrapped
51123 /// to call it as `Box::leak(b)` instead of `b.leak()`. This
51132 /// let static_ref: &'static mut usize = Box::leak(x);
51141 /// let static_ref = Box::leak(x);
51147 pub fn leak<'a>(b: Self) -> &'a mut T