about summary refs log tree commit diff
path: root/src/liballoc/tests
AgeCommit message (Collapse)AuthorLines
2019-02-18override `VecDeque::try_rfold`, also update iteratorAndre Bogus-0/+64
This keeps the slice based iteration and updates the iterator state after each slice. It also uses a loop to reduce the amount of code. This uses unsafe code, so some thorough review would be appreciated.
2019-02-16Rollup merge of #58433 - RalfJung:miri-mark-tests, r=TimNNkennytm-41/+98
Update which libcore/liballoc tests Miri ignores, and document why
2019-02-13miri: test with slightly larger BTreesRalf Jung-8/+10
2019-02-13review failures in heap, slice, vecRalf Jung-4/+32
2019-02-13review failures in btree, stringRalf Jung-5/+42
2019-02-13review failures in binary_heap, str, vec_dequeRalf Jung-33/+23
2019-02-12Stabilize slice_sort_by_cached_keyScott McMurray-1/+0
2019-02-12Auto merge of #58051 - SimonSapin:str_escape, r=alexcrichtonbors-31/+31
Stabilize str::escape_* methods with new return types… … that implement `Display` and `Iterator<Item=char>`, as proposed in FCP: https://github.com/rust-lang/rust/issues/27791#issuecomment-376864727
2019-02-12Stabilize str::escape_* methodsSimon Sapin-1/+0
FCP: https://github.com/rust-lang/rust/issues/27791#issuecomment-376864727
2019-02-12New return types for str::escape_* that impl Display and Iterator<char>Simon Sapin-30/+31
As FCP’ed in the tracking issue: https://github.com/rust-lang/rust/issues/27791#issuecomment-376864727
2019-02-10libs: doc commentsAlexander Regueiro-1/+1
2019-02-09Rollup merge of #58275 - RalfJung:miri-test-libcore, r=Mark-SimulacrumMazdak Farrokhzad-0/+43
libcore, liballoc: disable tests in Miri I am going to run the libcore and liballoc unit test suites in Miri. Not all tests pass. This PR disables a whole bunch of tests when running in Miri, to get us to a baseline from which I can investigate failures. Cc @SimonSapin @alexcrichton
2019-02-07disable tests in MiriRalf Jung-0/+43
2019-02-03liballoc: revert nested imports style changes.Mazdak Farrokhzad-78/+53
2019-02-02liballoc: elide &'static.Mazdak Farrokhzad-2/+2
2019-02-02liballoc: elide some lifetimes.Mazdak Farrokhzad-2/+2
2019-02-02liballoc: apply uniform_paths.Mazdak Farrokhzad-2/+2
2019-02-02liballoc: adjust abolute imports + more import fixes.Mazdak Farrokhzad-6/+6
2019-02-02liballoc: refactor & fix some imports.Mazdak Farrokhzad-62/+90
2019-01-30override `VecDeque`'s `Iter::try_fold`Andre Bogus-0/+37
2019-01-26Replace deprecated ATOMIC_INIT constsMark Rousskov-4/+4
2018-12-25Remove licensesMark Rousskov-160/+0
2018-12-22Auto merge of #56842 - scottmcm:vecdeque-rotate, r=alexcrichtonbors-1/+136
Add unstable VecDeque::rotate_{left|right} Like the ones on slices, but more efficient because vecdeque is a circular buffer. Issue that proposed this: https://github.com/rust-lang/rust/issues/56686 ~~:bomb: Please someone look very carefully at the `unsafe` in this! The `wrap_copy` seems to be exactly what this method needs, and the `len` passed to it is never more than half the length of the deque, but I haven't managed to prove to myself that it's correct :bomb:~~ I think I proved that this code meets the requirement of the unsafe code it's calling; please double-check, of course.
2018-12-19Auto merge of #56550 - chpio:rc-eq, r=alexcrichtonbors-0/+84
Short-circuit Rc/Arc equality checking on equal pointers where T: Eq based on #42965 Is the use of the private trait ok this way? Is there anything else needed for this to get pulled?
2018-12-19Add more VecDeque::rotate_{left|right} testsScott McMurray-1/+136
2018-12-15Rollup merge of #56713 - xfix:vec-test-zst-capacity, r=TimNNPietro Albini-0/+5
Test capacity of ZST vector Initially, #50233 accidentally changed the capacity of empty ZST. This was pointed out during code review. This commit adds a test to prevent capacity of ZST vectors from accidentally changing to prevent that from happening again.
2018-12-12Bump to 1.33.0Alex Crichton-4/+4
* Update bootstrap compiler * Update version to 1.33.0 * Remove some `#[cfg(stage0)]` annotations Actually updating the version number is blocked on updating Cargo
2018-12-11std: Depend directly on crates.io cratesAlex Crichton-4/+4
Ever since we added a Cargo-based build system for the compiler the standard library has always been a little special, it's never been able to depend on crates.io crates for runtime dependencies. This has been a result of various limitations, namely that Cargo doesn't understand that crates from crates.io depend on libcore, so Cargo tries to build crates before libcore is finished. I had an idea this afternoon, however, which lifts the strategy from #52919 to directly depend on crates.io crates from the standard library. After all is said and done this removes a whopping three submodules that we need to manage! The basic idea here is that for any crate `std` depends on it adds an *optional* dependency on an empty crate on crates.io, in this case named `rustc-std-workspace-core`. This crate is overridden via `[patch]` in this repository to point to a local crate we write, and *that* has a `path` dependency on libcore. Note that all `no_std` crates also depend on `compiler_builtins`, but if we're not using submodules we can publish `compiler_builtins` to crates.io and all crates can depend on it anyway! The basic strategy then looks like: * The standard library (or some transitive dep) decides to depend on a crate `foo`. * The standard library adds ```toml [dependencies] foo = { version = "0.1", features = ['rustc-dep-of-std'] } ``` * The crate `foo` has an optional dependency on `rustc-std-workspace-core` * The crate `foo` has an optional dependency on `compiler_builtins` * The crate `foo` has a feature `rustc-dep-of-std` which activates these crates and any other necessary infrastructure in the crate. A sample commit for `dlmalloc` [turns out to be quite simple][commit]. After that all `no_std` crates should largely build "as is" and still be publishable on crates.io! Notably they should be able to continue to use stable Rust if necessary, since the `rename-dependency` feature of Cargo is soon stabilizing. As a proof of concept, this commit removes the `dlmalloc`, `libcompiler_builtins`, and `libc` submodules from this repository. Long thorns in our side these are now gone for good and we can directly depend on crates.io! It's hoped that in the long term we can bring in other crates as necessary, but for now this is largely intended to simply make it easier to manage these crates and remove submodules. This should be a transparent non-breaking change for all users, but one possible stickler is that this almost for sure breaks out-of-tree `std`-building tools like `xargo` and `cargo-xbuild`. I think it should be relatively easy to get them working, however, as all that's needed is an entry in the `[patch]` section used to build the standard library. Hopefully we can work with these tools to solve this problem! [commit]: https://github.com/alexcrichton/dlmalloc-rs/commit/28ee12db813a3b650a7c25d1c36d2c17dcb88ae3
2018-12-11Test capacity of ZST vectorKonrad Borowski-0/+5
Initially, #50233 accidentally changed the capacity of empty ZST. This was pointed out during code review. This commit adds a test to prevent capacity of ZST vectors from accidentally changing to prevent that from happening again.
2018-12-08Add Arc/Rc Eq testsThomas Heck-0/+84
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-4/+4
2018-12-04Replace usages of `..i + 1` ranges with `..=i`.Corey Farwell-9/+9
2018-11-11std: Delete the `alloc_system` crateAlex Crichton-4/+1
This commit deletes the `alloc_system` crate from the standard distribution. This unstable crate is no longer needed in the modern stable global allocator world, but rather its functionality is folded directly into the standard library. The standard library was already the only stable location to access this crate, and as a result this should not affect any stable code.
2018-11-02Remove all jemalloc-related contentAlex Crichton-3/+0
This commit removes all jemalloc related submodules, configuration, etc, from the bootstrap, from the standard library, and from the compiler. This will be followed up with a change to use jemalloc specifically as part of rustc on blessed platforms.
2018-10-31Bump nightly to 1.32.0Alex Crichton-1/+0
* Also update the bootstrap compiler * Update cargo to 1.32.0 * Clean out stage0 annotations
2018-10-18Stabilize slice::rchunks(), rchunks_mut(), rchunks_exact(), rchunk_exact_mut()Sebastian Dröge-1/+0
Fixes #55177
2018-10-18Stabilize slice::chunks_exact() and slice::chunks_exact_mut()Sebastian Dröge-1/+0
Fixes #47115
2018-10-18Add slice::rchunks(), rchunks_mut(), rchunks_exact() and rchunks_exact_mut()Sebastian Dröge-2/+115
These work exactly like the normal chunks iterators but start creating chunks from the end of the slice. See #55177 for the tracking issue
2018-10-05Stabilize `min_const_fn`Oliver Schneider-1/+1
2018-09-27Bump to 1.31.0 and bootstrap from 1.30 betaJosh Stone-2/+1
2018-09-24Rename slice::exact_chunks() to slice::chunks_exact()Sebastian Dröge-16/+16
See https://github.com/rust-lang/rust/issues/47115#issuecomment-403090815 and https://github.com/rust-lang/rust/issues/47115#issuecomment-424053547
2018-09-05Auto merge of #52994 - varkor:trim_direction, r=alexcrichtonbors-30/+38
Add trim_start, trim_end etc.; deprecate trim_left, trim_right, etc. in future Adds the methods: `trim_start`, `trim_end`, `trim_start_matches` and `trim_end_matches`. Deprecates `trim_left`, `trim_right`, `trim_left_matches` and `trim_right_matches` starting from Rust 1.33.0, three versions from when they'll initially be marked as being deprecated, using the future deprecation from https://github.com/rust-lang/rust/issues/30785 and https://github.com/rust-lang/rust/pull/51681. Fixes https://github.com/rust-lang/rust/issues/30459.
2018-09-04Breaking change upgradesMark Rousskov-2/+3
2018-08-31Restrict most uses of `const_fn` to `min_const_fn`Oliver Schneider-1/+2
2018-08-23Stabilize 'attr_literals' feature.Sergio Benitez-1/+0
2018-08-19Remove old testsvarkor-50/+0
2018-08-18Auto merge of #52553 - Pazzaz:vecdeque-append, r=SimonSapinbors-0/+101
Non-naive implementation of `VecDeque.append` Replaces the old, simple implementation with a more manual (and **unsafe** 😱) one. I've added 1 more test and verified that it covers all 6 code paths in the function. This new implementation was about 60% faster than the old naive one when I tried benchmarking it.
2018-08-15Test VecDeque append not dropping twicePazzaz-0/+25
2018-08-05Make features stable and clarify examplesvarkor-1/+0
2018-08-05Fix stage 2 testsvarkor-2/+0