about summary refs log tree commit diff
path: root/src/liballoc
AgeCommit message (Collapse)AuthorLines
2019-04-26Use "capacity" as parameter name in with_capacity() methodsMatthias Geier-4/+4
Closes #60271.
2019-04-25ignore-tidy-filelength on all files with greater than 3000 linesvarkor-0/+2
2019-04-23Stabilize futures_apiTaylor Cramer-2/+1
2019-04-22Remove double trailing newlinesvarkor-1/+0
2019-04-20Deny rust_2018_idioms in liballoc testsPhilipp Hansch-14/+15
2019-04-19Add implementations of last in terms of next_back on a bunch of ↵Kyle Huey-0/+88
DoubleEndedIterators. r?Manishearth
2019-04-19Auto merge of #60072 - RalfJung:linked-list, r=shepmasterbors-11/+37
fix LinkedList invalidating mutable references The test `test_insert_prev` failed in Miri due to what I consider a bug in `LinkedList`: in various places, `NonNull::as_mut` got called to modify the `prev`/`next` pointers of existing nodes. In particular, the unstable `insert_next` has to modify the `next` pointer of the node that was last handed out by the iterator; to this end it creates a mutable reference to the *entire node* that overlaps with the mutable reference to the node's content that was handed out by the iterator! Thus, the next use if said mutable reference is UB. In code: ```rust loop { match it.next() { // mutable reference handed to us None => break, Some(elt) => { it.insert_next(*elt + 1); // this invalidates `elt` because it creates an overlapping mutable reference match it.peek_next() { Some(x) => assert_eq!(*x, *elt + 2), // this use of `elt` now is a use of an invalid pointer None => assert_eq!(8, *elt), } } } } ``` This PR fixes that by using `as_ptr` instead of `as_mut`. This avoids invalidating the mutable reference that was handed to the user. I did this in all methods called by iterators, just to be sure. Cc @Gankro
2019-04-19fix LinkedList invalidating mutable referencesRalf Jung-11/+37
2019-04-19Auto merge of #60077 - RalfJung:miri-alloc-tests, r=joshtriplettbors-1/+15
make liballoc internal test suite mostly pass in Miri I discovered, to my surprise, that liballoc has two test suites: `liballoc/tests`, and a bunch of stuff embedded directly within liballoc. The latter was not covered by [miri-test-libstd](https://github.com/RalfJung/miri-test-libstd) yet. This disables in Miri the tests that Miri cannot support or runs too slowly.
2019-04-19move variable down to where it is usedRalf Jung-5/+5
2019-04-19Rollup merge of #59933 - sourcefrog:doc-fmt, r=shepmasterMazdak Farrokhzad-3/+4
Make clear that format padding doesn't work for Debug As mentioned in https://github.com/rust-lang/rust/issues/46006#issuecomment-345260633
2019-04-18make liballoc internal test suite mostly pass in MiriRalf Jung-1/+15
2019-04-18Rollup merge of #59908 - lzutao:str_escape, r=SimonSapinMazdak Farrokhzad-0/+2
Re-export core::str::{EscapeDebug, EscapeDefault, EscapeUnicode} in std cc #59893
2019-04-17test sort_unstable in MiriRalf Jung-3/+3
2019-04-16Miri now supports entropy, but is still slowRalf Jung-7/+16
2019-04-15warn(missing_docs) in liballoc, and add missing docsRalf Jung-0/+13
2019-04-14make lint levels more consistentRalf Jung-3/+3
2019-04-14bump stdsimd; make intra_doc_link_resolution_failure an error againRalf Jung-1/+1
2019-04-14Rollup merge of #59675 - SimonSapin:stable-alloc, r=alexcrichtonMazdak Farrokhzad-7/+3
Stabilize the `alloc` crate. This implements RFC 2480: * https://github.com/rust-lang/rfcs/pull/2480 * https://github.com/rust-lang/rfcs/blob/master/text/2480-liballoc.md Closes https://github.com/rust-lang/rust/issues/27783
2019-04-13Make clear that format padding doesn't work for DebugMartin Pool-3/+4
As mentioned in https://github.com/rust-lang/rust/issues/46006#issuecomment-345260633
2019-04-12Stabilize the `alloc` crate.Simon Sapin-7/+3
This implements RFC 2480: * https://github.com/rust-lang/rfcs/pull/2480 * https://github.com/rust-lang/rfcs/blob/master/text/2480-liballoc.md Closes https://github.com/rust-lang/rust/issues/27783
2019-04-12Rollup merge of #59814 - ollie27:dead_boxed_links, r=QuietMisdreavusMazdak Farrokhzad-0/+2
Fix broken links on std::boxed doc page r? @QuietMisdreavus
2019-04-12Re-export core::str::{EscapeDebug, EscapeDefault, EscapeUnicode} in stdLzu Tao-0/+2
2019-04-11Fix broken links on std::boxed doc pageOliver Middleton-0/+2
2019-04-10Update cmake, cc and compiler_builtins for VS 2019 supportJohn Kåre Alsaker-1/+1
2019-04-09string: implement From<&String> for StringJeremy Fitzhardinge-0/+8
Allow Strings to be created from borrowed Strings. This is mostly to make things like passing &String to an `impl Into<String>` parameter frictionless.
2019-04-07Auto merge of #59119 - cramertj:cx-back, r=withoutboatsbors-3/+3
Future-proof the Futures API cc https://github.com/rust-lang/rust/issues/59113, @carllerche, @rust-lang/libs r? @withoutboats
2019-04-05Future-proof the Futures APITaylor Cramer-3/+3
2019-04-05Use for_each to extend collectionsJosh Stone-13/+7
This updates the `Extend` implementations to use `for_each` for many collections: `BinaryHeap`, `BTreeMap`, `BTreeSet`, `LinkedList`, `Path`, `TokenStream`, `VecDeque`, and `Wtf8Buf`. Folding with `for_each` enables better performance than a `for`-loop for some iterators, especially if they can just forward to internal iterators, like `Chain` and `FlatMap` do.
2019-04-05Stabilize boxed_closure_impls in 1.35.0.Charles Lew-9/+3
2019-04-05Remove FnBox specialization of impl FnOnce for Box<impl FnOnce>.Masaki Hara-17/+1
2019-04-05We already have unsized_locals in stage0.Masaki Hara-9/+0
2019-04-05Add Fn* blanket impls for Box.Masaki Hara-0/+34
2019-04-05Make FnBox a subtrait of FnOnce.Masaki Hara-5/+1
2019-04-03Rollup merge of #59186 - ssomers:btreeset_intersection_revisited_again, ↵Mazdak Farrokhzad-122/+351
r=KodrAus improve worst-case performance of BTreeSet intersection v3 Variation of [#59078](https://github.com/rust-lang/rust/pull/59078) with `Intersection` remaining a struct r? @scottmcm
2019-03-30Fix doc testsFabian Drinck-1/+1
2019-03-29improve worst-case performance of BTreeSet difference and intersectionStein Somers-122/+351
2019-03-26adjust MaybeUninit API to discussionsRalf Jung-5/+5
uninitialized -> uninit into_initialized -> assume_init read_initialized -> read set -> write
2019-03-24Rollup merge of #59328 - koalatux:iter-nth-back, r=scottmcmkennytm-0/+4
Implement specialized nth_back() for Box and Windows. Hi there, this is my first pull request to rust :-) I started implementing some specializations for DoubleEndedIterator::nth_back() and these are the first two. The problem has been discussed in #54054 and nth_back() is tracked in #56995. I'm stuck with the next implementation so I though I do a PR for the ones I'm confident with to get some feedback.
2019-03-16Rollup merge of #59206 - sntdevco:master, r=dtolnaykennytm-1/+1
Improved test output
2019-03-16Rollup merge of #59072 - RalfJung:miri-alloc-tests, r=kennytmkennytm-57/+3
we can now skip should_panic tests with the libtest harness
2019-03-16Rollup merge of #58933 - SimonSapin:alloc-prelude-v1, r=Amanieukennytm-19/+27
Move alloc::prelude::* to alloc::prelude::v1, make alloc a subset of std This was one of the unresolved questions of https://github.com/rust-lang/rfcs/pull/2480. As the RFC says this is maybe not useful in the sense that we are unlikely to ever have a second version, but making the crate a true subset makes one less issue to think about if we stabilize it and later want to merge standard library crates and have Cargo feature flags to enable or disable parts of the `std` crate. See also discussion in https://github.com/rust-lang/rust/pull/58175. Also rename the feature gate and point to a dedicated tracking issue: https://github.com/rust-lang/rust/issues/58935
2019-03-15Improved test output for liballoc/strsntdevco-1/+1
2019-03-10enabled too many testsRalf Jung-1/+3
2019-03-10we can now skip should_panic tests with the libtest harnessRalf Jung-57/+1
2019-03-09Use lifetime contravariance to elide more lifetimes in core+alloc+stdScott McMurray-16/+16
2019-03-05Add a tracking issue for new as_slice methodsJosh Stone-1/+1
2019-03-05Rename the feature gate for alloc::preludeSimon Sapin-7/+8
… to separate it from that of the crate. New tracking issue: https://github.com/rust-lang/rust/issues/58935
2019-03-05Move alloc::prelude::* to alloc::prelude::v1, make alloc a subset of stdSimon Sapin-10/+17
This was one of the unresolved questions of https://github.com/rust-lang/rfcs/pull/2480. As the RFC says this is maybe not useful in the sense that we are unlikely to ever have a second version, but making the crate a true subset makes one less issue to think about if we stabilize it and later want to merge standard library crates and have Cargo feature flags to enable or disable parts of the `std` crate. See also discussion in https://github.com/rust-lang/rust/pull/58175
2019-03-04Add as_slice() to slice::IterMut and vec::DrainJosh Stone-0/+19
In bluss/indexmap#88, we found that there was no easy way to implement `Debug` for our `IterMut` and `Drain` iterators. Those are built on `slice::IterMut` and `vec::Drain`, which implement `Debug` themselves, but have no other way to access their data. With a new `as_slice()` method, we can read the data and customize its presentation.