summary refs log tree commit diff
path: root/src/libcollections/btree
AgeCommit message (Collapse)AuthorLines
2016-02-23Register new snapshotsAaron Turon-2/+2
2016-02-15clarify how insert() doesn't update keysJack O'Connor-3/+4
The first time I read the docs for `insert()`, I thought it was saying it didn't update existing *values*, and I was confused. Reword the docs to make it clear that `insert()` does update values.
2016-02-09Minor spelling fixesCarlos E. Garcia-1/+1
2016-01-26Add size hints for BTreeSet iteratorsMatt Brubeck-2/+27
2016-01-22Document that BTreeMap iteration is in orderMatt Brubeck-10/+10
Also change the examples to make this more obvious. Fixes #31129.
2016-01-20Auto merge of #31038 - gereeter:btree-panic, r=Gankrobors-2/+2
…ving elements into it. Fixes #31029.
2016-01-19In BTreeMap's merge function, adjust the length of the node before moving ↵Jonathan S-2/+2
elements into it.
2016-01-18Make `btree_set::{IntoIter, Iter, Range}` covariantAndrew Paseltiner-19/+9
CC #30642
2016-01-17Fix and test variance of BTreeMap and its companion structs.Jonathan S-17/+39
2016-01-16Rewrite BTreeMap to use parent pointers.Jonathan S-2591/+1880
2016-01-16Auto merge of #30939 - shepmaster:btreeset-insert-return-value, r=alexcrichtonbors-1/+1
2016-01-15BTreeSet::insert returns false when key already existsJake Goulding-1/+1
2016-01-14Require stability annotations on fields of tuple variantsVadim Petrochenkov-2/+6
2016-01-04Feature-gate defaulted type parameters outside of types.Niko Matsakis-12/+12
2015-12-18Fix the falloutVadim Petrochenkov-6/+6
2015-12-17Remove unused importsJeffrey Seyfried-1/+1
2015-12-14Add links in BTreeSet docsOri Avtalion-3/+8
2015-12-10std: Remove deprecated functionality from 1.5Alex Crichton-30/+5
This is a standard "clean out libstd" commit which removes all 1.5-and-before deprecated functionality as it's now all been deprecated for at least one entire cycle.
2015-11-25Auto merge of #30017 - nrc:fmt, r=brsonbors-386/+566
2015-11-24rustfmt libcollectionsNick Cameron-386/+566
2015-11-20Rename #[deprecated] to #[rustc_deprecated]Vadim Petrochenkov-2/+2
2015-11-18Add missing annotations and some testsVadim Petrochenkov-1/+0
2015-11-16Auto merge of #29830 - petrochenkov:mapdoc, r=alexcrichtonbors-2/+3
r? @steveklabnik
2015-11-14docs: Clarify insertion behavior for mapsVadim Petrochenkov-2/+3
2015-11-12libcollections: deny warnings in doctestsKevin Butler-0/+1
2015-11-06Remove stability annotations from trait impl itemsVadim Petrochenkov-2/+0
Remove `stable` stability annotations from inherent impls
2015-10-22Document replacement behavior in some collectionsSteve Klabnik-4/+16
{BTree,Hash}{Map,Set} will not update their key if it already exists, which can matter with more complex keys. This behavior is now documented. Fixes #26888
2015-10-13Correct spelling in docsAndrew Paseltiner-2/+2
2015-10-10Auto merge of #28861 - pnkfelix:fsk-nonparam-dropck-issue28498, r=arielb1bors-0/+3
implement RFC 1238: nonparametric dropck. cc #28498 cc @nikomatsakis
2015-10-08typos: fix a grabbag of typos all over the placeCristi Cobzarenco-1/+1
2015-10-06Add RFC 1238's `unsafe_destructor_blind_to_params` (UGEH) where needed.Felix S. Klock II-0/+3
I needed it in `RawVec`, `Vec`, and `TypedArena` for `rustc` to bootstrap; but of course that alone was not sufficient for `make check`. Later I added `unsafe_destructor_blind_to_params` to collections, in particular `LinkedList` and `RawTable` (the backing representation for `HashMap` and `HashSet`), to get the regression tests exercising cyclic structure from PR #27185 building. ---- Note that the feature is `dropck_parametricity` (which is not the same as the attribute's name). We will almost certainly vary our strategy here in the future, so it makes some sense to have a not-as-ugly name for the feature gate. (The attribute name was deliberately selected to be ugly looking.)
2015-09-30Auto merge of #28731 - bluss:by-ref, r=alexcrichtonbors-1/+1
Remove redundant uses of Iterator::by_ref()
2015-09-29Remove redundant uses of Iterator::by_ref()Ulrik Sverdrup-1/+1
2015-09-18Avoid zero-sized leaf allocations in `BTreeMap`Andrew Paseltiner-1/+6
When both the key and value types were zero-sized, `BTreeMap` previously called `heap::allocate` with `size == 0` for leaf nodes, which is undefined behavior, and jemalloc would attempt to read invalid memory, crashing the process. This avoids undefined behavior by allocating enough space to store one edge in leaf nodes that would otherwise have `size == 0`. Although this uses extra memory, maps with zero-sized key types that have sensible implementations of the ordering traits can only contain a single key-value pair (and therefore only a single leaf node), and maps with key and value types that are both zero-sized have few uses, if any. Furthermore, this is a temporary fix that will likely be unnecessary once the `BTreeMap` implementation is rewritten to use parent pointers. Closes #28493.
2015-09-11std: Stabilize/deprecate features for 1.4Alex Crichton-0/+5
The FCP is coming to a close and 1.4 is coming out soon, so this brings in the libs team decision for all library features this cycle. Stabilized APIs: * `<Box<str>>::into_string` * `Arc::downgrade` * `Arc::get_mut` * `Arc::make_mut` * `Arc::try_unwrap` * `Box::from_raw` * `Box::into_raw` * `CStr::to_str` * `CStr::to_string_lossy` * `CString::from_raw` * `CString::into_raw` * `IntoRawFd::into_raw_fd` * `IntoRawFd` * `IntoRawHandle::into_raw_handle` * `IntoRawHandle` * `IntoRawSocket::into_raw_socket` * `IntoRawSocket` * `Rc::downgrade` * `Rc::get_mut` * `Rc::make_mut` * `Rc::try_unwrap` * `Result::expect` * `String::into_boxed_slice` * `TcpSocket::read_timeout` * `TcpSocket::set_read_timeout` * `TcpSocket::set_write_timeout` * `TcpSocket::write_timeout` * `UdpSocket::read_timeout` * `UdpSocket::set_read_timeout` * `UdpSocket::set_write_timeout` * `UdpSocket::write_timeout` * `Vec::append` * `Vec::split_off` * `VecDeque::append` * `VecDeque::retain` * `VecDeque::split_off` * `rc::Weak::upgrade` * `rc::Weak` * `slice::Iter::as_slice` * `slice::IterMut::into_slice` * `str::CharIndices::as_str` * `str::Chars::as_str` * `str::split_at_mut` * `str::split_at` * `sync::Weak::upgrade` * `sync::Weak` * `thread::park_timeout` * `thread::sleep` Deprecated APIs * `BTreeMap::with_b` * `BTreeSet::with_b` * `Option::as_mut_slice` * `Option::as_slice` * `Result::as_mut_slice` * `Result::as_slice` * `f32::from_str_radix` * `f64::from_str_radix` Closes #27277 Closes #27718 Closes #27736 Closes #27764 Closes #27765 Closes #27766 Closes #27767 Closes #27768 Closes #27769 Closes #27771 Closes #27773 Closes #27775 Closes #27776 Closes #27785 Closes #27792 Closes #27795 Closes #27797
2015-09-03Use `null()`/`null_mut()` instead of `0 as *const T`/`0 as *mut T`Vadim Petrochenkov-1/+1
2015-08-31hide docs for private `collections::btree::Recover` traitAndrew Paseltiner-0/+1
closes #28093
2015-08-28implement RFC 1194Andrew Paseltiner-9/+128
2015-08-26Make iter::order functions into methods on IteratorSteven Fackler-3/+3
This does cause some breakage due to deficiencies in resolve - `path::Components` is both an `Iterator` and implements `Eq`, `Ord`, etc. If one calls e.g. `partial_cmp` on a `Components` and passes a `&Components` intending to target the `PartialOrd` impl, the compiler will select the `partial_cmp` from `Iterator` and then error out. I doubt anyone will run into breakage from `Components` specifically, but we should see if there are third party types that will run into issues. `iter::order::equals` wasn't moved to `Iterator` since it's exactly the same as `iter::order::eq` but with an `Eq` instead of `PartialEq` bound, which doensn't seem very useful. I also updated `le`, `gt`, etc to use `partial_cmp` which lets us drop the extra `PartialEq` bound. cc #27737
2015-08-18Auto merge of #27624 - apasel422:issue-27620, r=Gankrobors-2/+23
Closes #27620.
2015-08-15collections: Add issues for unstable featuresAlex Crichton-4/+11
2015-08-12Remove all unstable deprecated functionalityAlex Crichton-12/+0
This commit removes all unstable and deprecated functions in the standard library. A release was recently cut (1.3) which makes this a good time for some spring cleaning of the deprecated functions.
2015-08-11Register new snapshotsAlex Crichton-11/+0
* Lots of core prelude imports removed * Makefile support for MSVC env vars and Rust crates removed * Makefile support for morestack removed
2015-08-10Remove transmute from `btree::node::Node::as_slices_internal_mut`Andrew Paseltiner-2/+23
Closes #27620.
2015-08-09Change TODO to FIXMETobias Bucher-1/+1
2015-08-09Replace many uses of `mem::transmute` with more specific functionsTobias Bucher-6/+7
The replacements are functions that usually use a single `mem::transmute` in their body and restrict input and output via more concrete types than `T` and `U`. Worth noting are the `transmute` functions for slices and the `from_utf8*` family for mutable slices. Additionally, `mem::transmute` was often used for casting raw pointers, when you can already cast raw pointers just fine with `as`.
2015-08-05Fully generalize `BTree{Map, Set}` range iteratorsAndrew Paseltiner-6/+22
This permits collections with `String` keys to be ranged over with `&str` bounds. The `K` defaults for `Min` and `Max` permit the default type parameter fallback to work with things like ```rust use std::collections::{BTreeSet, Bound}; let set = BTreeSet::<String>::new(); set.range(Bound::Included("a"), Bound::Unbounded); ``` Without the defaults, the type of the maximum bound would be unconstrained.
2015-08-03syntax: Implement #![no_core]Alex Crichton-4/+8
This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The `#![no_std]` attribute now injects `extern crate core` at the top of the crate as well as the libcore prelude into all modules (in the same manner as the standard library's prelude). The `#![no_core]` attribute disables both std and core injection. [rfc]: https://github.com/rust-lang/rfcs/pull/1184
2015-07-27Show appropriate feature flags in docsSteve Klabnik-3/+6
2015-06-24Make `align_of` behave like `min_align_of`.Huon Wilson-5/+5
This removes a footgun, since it is a reasonable assumption to make that pointers to `T` will be aligned to `align_of::<T>()`. This also matches the behaviour of C/C++. `min_align_of` is now deprecated. Closes #21611.