Lines Matching refs:boxed
6941 // If the boxed pointers were leaked or otherwise misused, valgrind
8876 mod boxed;
13903 /// to the same boxed integer value, not five references pointing to independently
13904 /// boxed integers.
14435 use crate::boxed::Box;
15007 use crate::boxed::Box;
15534 /// Converts a boxed slice of bytes to a boxed string slice without checking
15554 use std::boxed::Box;
16227 use crate::boxed::Box;
18541 /// Converts the given boxed `str` slice to a `String`.
18562 /// Converts the given `String` to a boxed `str` slice that is owned.
19353 //! [`Box`]: boxed
19465 // Need to conditionally define the mod from `boxed.rs` to avoid
19467 // to allow code to have `use boxed::Box;` declarations.
19469 pub mod boxed;
19471 mod boxed {
19472 pub use std::boxed::Box;
19741 use crate::boxed::Box;
19743 use std::boxed::Box;
21271 /// Move a boxed object to a new, reference counted, allocation.
22063 use crate::boxed::Box;
22118 use crate::boxed::Box;
23299 use crate::boxed::Box;
25612 /// Move a boxed object to a new, reference-counted allocation.
26386 use std::boxed::Box;
26968 use crate::boxed::Box;
35563 use crate::boxed::Box;
37961 use crate::boxed::Box;
38001 /// Creates a new boxed `LeafNode`.
38028 /// Creates a new boxed `InternalNode`.
44064 use crate::boxed::Box;
46496 use crate::boxed::Box;
46878 use crate::boxed::Box;
49609 /// Convert a boxed slice into a vector by transferring ownership of
49627 /// Convert a vector into a boxed slice.
50136 pub use crate::boxed::Box;
50144 use crate::boxed::Box;
50184 //! let boxed: Box<u8> = Box::new(val);
50190 //! let boxed: Box<u8> = Box::new(5);
50191 //! let val: u8 = *boxed;
50209 //! Recursive structures must be boxed, because if the definition of `Cons`
50331 /// See the [module-level documentation](../../std/boxed/index.html) for more.
50505 let mut boxed = Self::new_uninit_in(alloc);
50507 boxed.as_mut_ptr().write(x);
50508 boxed.assume_init()
50530 let mut boxed = Self::try_new_uninit_in(alloc)?;
50532 boxed.as_mut_ptr().write(x);
50533 Ok(boxed.assume_init())
50676 pub fn into_boxed_slice(boxed: Self) -> Box<[T], A> {
50677 let (raw, alloc) = Box::into_raw_with_allocator(boxed);
50694 pub fn into_inner(boxed: Self) -> T {
50695 *boxed
50700 /// Constructs a new boxed slice with uninitialized contents.
50725 /// Constructs a new boxed slice with uninitialized contents, with the memory
50750 /// Constructs a new boxed slice with uninitialized contents in the provided allocator.
50778 /// Constructs a new boxed slice with uninitialized contents in the provided allocator,
51160 pub fn into_pin(boxed: Self) -> Pin<Self>
51167 unsafe { Pin::new_unchecked(boxed) }
51219 let mut boxed = Self::new_uninit_in(self.1.clone());
51221 (**self).write_clone_into_raw(boxed.as_mut_ptr());
51222 boxed.assume_init()
51365 /// let boxed = Box::new(5);
51367 /// assert_eq!(Box::from(x), boxed);
51382 fn from(boxed: Box<T, A>) -> Self {
51383 Box::into_pin(boxed)
51432 /// let boxed: Box<str> = Box::from("hello");
51433 /// println!("{}", boxed);
51461 /// let boxed: Box<str> = Box::from("hello");
51462 /// let boxed_str: Box<[u8]> = Box::from(boxed);
51485 /// let boxed: Box<[u8]> = Box::from([4, 2]);
51486 /// println!("{:?}", boxed);
51945 //! Test for `boxed` mod.
51953 use std::boxed::Box;
52059 let boxed: Box<[f64]> = Box::from(slice);
52060 assert_eq!(&*boxed, slice)
52066 let boxed: Box<[i64]> = Box::from(slice);
52067 assert_eq!(&*boxed, slice)
52073 let boxed: Box<str> = Box::from(s);
52074 assert_eq!(&*boxed, s)
52080 let boxed: Box<[u32]> = iter.collect();
52081 assert_eq!(boxed.len(), 100);
52082 assert_eq!(boxed[7], 7);