pub unsafe fn from_raw(raw: *mut BitSlice<T, O>) -> Self {
		Self {
			bitspan: BitSpan::from_bitslice_ptr_mut(raw),
		}
	}
/// Constructs a bit-box from a raw bit-slice pointer.
///
/// This converts a `*mut BitSlice` pointer that had previously been
/// produced by either [`::into_raw()`] or [`::leak()`] and restores the
/// bit-box containing it.
///
/// ## Original
///
/// [`Box::from_raw`](alloc::boxed::Box::from_raw)
///
/// ## Safety
///
/// You must only call this function on pointers produced by leaking a prior
/// `BitBox`; you may not modify the value of a pointer returned by
/// [`::into_raw()`], nor may you conjure pointer values of your own. Doing
/// so will corrupt the allocator state.
///
/// You must only call this function on any given leaked pointer at most
/// once. Not calling it at all will merely render the allocated memory
/// unreachable for the duration of the program runtime, a normal (and safe)
/// memory leak. Calling it once restores ordinary functionality, and
/// ensures ordinary destruction at or before program termination. However,
/// calling it more than once on the same pointer will introduce data races,
/// use-after-free, and/or double-free errors.
///
/// ## Examples
///
/// ```rust
/// use bitvec::prelude::*;
///
/// let bb = bitbox![0; 80];
/// let ptr: *mut BitSlice = BitBox::into_raw(bb);
/// let bb = unsafe { BitBox::from_raw(ptr) };
/// // unsafe { BitBox::from_raw(ptr) }; // UAF crash!
/// ```
///
/// [`::into_raw()`]: Self::into_raw
/// [`::leak()`]: Self::leak
Constructs a bit-box from a raw bit-slice pointer.
Constructs a bit - box from a raw bit - slice pointer .
pub unsafe fn from_raw(raw: *mut BitSlice<T, O>) -> Self {
		Self {
			bitspan: BitSpan::from_bitslice_ptr_mut(raw),
		}
	}
pub unsafe fn from_raw ( raw : * mut BitSlice < T , O > ) -> Self { Self { bitspan : BitSpan :: from_bitslice_ptr_mut ( raw ) , } }
Constructs a bit-box from a raw bit-slice pointer.
Constructs a bit - box from a raw bit - slice pointer .
raw
*mut BitSlice<T, O>
raw
*mut BitSlice<T, O>
original
None
safety
You must only call this function on pointers produced by leaking a prior
`BitBox`; you may not modify the value of a pointer returned by
[`::into_raw()`], nor may you conjure pointer values of your own. Doing
so will corrupt the allocator state.

You must only call this function on any given leaked pointer at most
once. Not calling it at all will merely render the allocated memory
unreachable for the duration of the program runtime, a normal (and safe)
memory leak. Calling it once restores ordinary functionality, and
ensures ordinary destruction at or before program termination. However,
calling it more than once on the same pointer will introduce data races,
use-after-free, and/or double-free errors.
You must only call this function on pointers produced by leaking a prior ` BitBox ` ; you may not modify the value of a pointer returned by [ ` :: into_raw () ` ] nor may you conjure pointer values of your own . Doing so will corrupt the allocator state . You must only call this function on any given leaked pointer at most once . Not calling it at all will merely render the allocated memory unreachable for the duration of the program runtime a normal ( and safe ) memory leak . Calling it once restores ordinary functionality and ensures ordinary destruction at or before program termination . However calling it more than once on the same pointer will introduce data races use - after - free and / or double - free errors .
examples
```rust
use bitvec::prelude::*.

let bb = bitbox![0; 80];
let ptr: *mut BitSlice = BitBox::into_raw(bb);
let bb = unsafe { BitBox::from_raw(ptr) };
unsafe { BitBox::from_raw(ptr) }; // UAF crash.


` ` ` rust use bitvec :: prelude :: * . let bb = bitbox! [ 0 ; 80 ] ; let ptr : * mut BitSlice = BitBox :: into_raw ( bb ) ; let bb = unsafe { BitBox :: from_raw ( ptr ) } ; unsafe { BitBox :: from_raw ( ptr ) } ; // UAF crash .