about summary refs log tree commit diff
path: root/src/liballoc/boxed_test.rs
AgeCommit message (Collapse)AuthorLines
2019-06-16Separate liballoc modulechansuke-140/+0
2018-12-25Remove licensesMark Rousskov-10/+0
2018-11-10add FromIterator<A> to Box<[A]>Axary-0/+8
2018-07-10Add missing dyn in liballocljedrz-10/+10
2017-02-06Direct conversions between slices and boxes.Clar Charr-0/+23
2016-05-28rustfmt liballoc folderSrinivas Reddy Thatiparthy-1/+1
2016-01-26Fix warnings during testsAlex Crichton-1/+0
The deny(warnings) attribute is now enabled for tests so we need to weed out these warnings as well.
2015-11-24rustfmt: liballoc, liballoc_*, libarenaNick Cameron-2/+1
2015-09-24rustfmt liballocNick Cameron-5/+10
2015-06-26Use Box::into_raw rather than the deprecated boxed::into_raw in tests and ↵Ms2ger-4/+4
documentation.
2015-04-01Fallout in libstd: remove impls now considered to conflict.Niko Matsakis-4/+4
2015-03-30std: Stabilize the rest of Any/BoxAnyAlex Crichton-1/+0
This commit stabilizes the following APIs: * `TypeId::of` - now that it has an `Any` bound it's ready to be stable. * `Box<Any>::downcast` - now that an inherent impl on `Box<Any>` as well as `Box<Any+Send>` is allowed the `BoxAny` trait is removed in favor of these inherent methods. This is a breaking change due to the removal of the `BoxAny` trait, but consumers can simply remove imports to fix crates. [breaking-change]
2015-03-05Remove integer suffixes where the types in compiled code are identical.Eduard Burtescu-2/+2
2015-02-09int/uint => isize/usize in liblibc/liballoc/libarenawe-5/+5
2015-02-02Auto merge of #21647 - alfie:suffix-medium, r=alexcrichtonbors-5/+5
2015-02-01box: into_raw, from_raw functionsStepan Koltsov-0/+42
Functions are needed for safety and convenience. It is a common pattern to use `mem::transmute` to convert between `Box` and raw pointer, like this: ``` let b = Box::new(3); let p = mem::transmute(b); // pass `p` to some C library ``` After this commit, conversion can be written as: ``` let p = boxed::into_raw(b); ``` `into_raw` and `from_raw` functions are still unsafe, but they are much safer than `mem::transmute`, because *raw functions do not convert between incompatible pointers. For example, this likely incorrect code can be successfully compiled: ``` let p: *mut u64 = ... let b: Box<u32> = mem::transmute(p); ``` Using `from_raw` results in compile-time error: ``` let p: *mut u64 = ... let b: Box<u32> = Box::from_raw(p); // compile-time error ``` `into_raw` and `from_raw` functions are similar to C++ `std::unique_ptr` `release` function [1] and constructor from pointer [2]. [1] http://en.cppreference.com/w/cpp/memory/unique_ptr/release [2] http://en.cppreference.com/w/cpp/memory/unique_ptr/unique_ptr
2015-02-01More deprecating of i/u suffixes in librariesAlfie John-5/+5
2015-01-30Remove all `i` suffixesTobias Bucher-1/+1
2015-01-20alloc::boxed: enable testStepan Koltsov-0/+75
Previously test was disabled due to `#[cfg(test)]` before `mod boxed`.