about summary refs log tree commit diff
path: root/src/libstd/collections/hash
AgeCommit message (Collapse)AuthorLines
2015-02-18Round 1 fixes and rebase conflictsAlex Crichton-4/+6
2015-02-18Stabilize std::borrowAaron Turon-16/+16
This commit stabilizes `std::borrow`, making the following modifications to catch up the API with language changes: * It renames `BorrowFrom` to `Borrow`, as was originally intended (but blocked for technical reasons), and reorders the parameters accordingly. * It moves the type parameter of `ToOwned` to an associated type. This is somewhat less flexible, in that each borrowed type must have a unique owned type, but leads to a significant simplification for `Cow`. Flexibility can be regained by using newtyped slices, which is advisable for other reasons anyway. * It removes the owned type parameter from `Cow`, making the type much less verbose. * Deprecates the `is_owned` and `is_borrowed` predicates in favor of direct matching. The above API changes are relatively minor; the basic functionality remains the same, and essentially the whole module is now marked `#[stable]`. [breaking-change]
2015-02-18rollup merge of #22491: Gankro/into_iterAlex Crichton-4/+6
Conflicts: src/libcollections/bit.rs src/libcollections/linked_list.rs src/libcollections/vec_deque.rs src/libstd/sys/common/wtf8.rs
2015-02-18make FromIterator use IntoIteratorAlexis-2/+4
This breaks all implementors of FromIterator, as they must now accept IntoIterator instead of Iterator. The fix for this is generally trivial (change the bound, and maybe call into_iter() on the argument to get the old argument). Users of FromIterator should be unaffected because Iterators are IntoIterator. [breaking-change]
2015-02-18make Extend use IntoIteratorAlexis-2/+2
This breaks all implementors of Extend, as they must now accept IntoIterator instead of Iterator. The fix for this is generally trivial (change the bound, and maybe call into_iter() on the argument to get the old argument). Users of Extend should be unaffected because Iterators are IntoIterator. [breaking-change]
2015-02-18std: Stabilize the `hash` moduleAlex Crichton-158/+3696
This commit is an implementation of [RFC 823][rfc] which is another pass over the `std::hash` module for stabilization. The contents of the module were not entirely marked stable, but some portions which remained quite similar to the previous incarnation are now marked `#[stable]`. Specifically: [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0823-hash-simplification.md * `std::hash` is now stable (the name) * `Hash` is now stable * `Hash::hash` is now stable * `Hasher` is now stable * `SipHasher` is now stable * `SipHasher::new` and `new_with_keys` are now stable * `Hasher for SipHasher` is now stable * Many `Hash` implementations are now stable All other portions of the `hash` module remain `#[unstable]` as they are less commonly used and were recently redesigned. This commit is a breaking change due to the modifications to the `std::hash` API and more details can be found on the [RFC][rfc]. Closes #22467 [breaking-change]
2015-02-18Fallout: add phantomdata to hashNiko Matsakis-3/+4
2015-02-18Fallout: port hashmap to use UniqueNiko Matsakis-23/+39
2015-02-17Register new snapshotsAlex Crichton-75/+0
2015-02-17std: Stabilize the IntoIterator traitAlex Crichton-0/+5
Now that the necessary associated types exist for the `IntoIterator` trait this commit stabilizes the trait as-is as well as all existing implementations.
2015-02-17Rollup merge of #22313 - japaric:iter, r=aturonManish Goregaokar-0/+80
`IntoIterator` now has an extra associated item: ``` rust trait IntoIterator { type Item; type IntoIter: Iterator<Self=Self::Item>; } ``` This lets you bind the iterator \"`Item`\" directly when writing generic functions: ``` rust // hypothetical change, not included in this PR impl Extend<T> for Vec<T> { // you can now write fn extend<I>(&mut self, it: I) where I: IntoIterator<Item=T> { .. } // instead of fn extend<I: IntoIterator>(&mut self, it: I) where I::IntoIter: Iterator<Item=T> { .. } } ``` The downside is that now you have to write an extra associated type in your `IntoIterator` implementations: ``` diff impl<T> IntoIterator for Vec<T> { + type Item = T; type IntoIter = IntoIter<T>; fn into_iter(self) -> IntoIter<T> { .. } } ``` Because this breaks all downstream implementations of `IntoIterator`, this is a [breaking-change] --- r? @aturon
2015-02-13add an associated `Item` type to `IntoIterator`Jorge Aparicio-0/+80
2015-02-13more int and cloned cleanup in collectionsAlexis-24/+24
2015-02-09std: Rename IntoIterator::Iter to IntoIterAlex Crichton-5/+5
This is in preparation for stabilization of the `IntoIterator` trait. All implementations and references to `Iter` need to be renamed to `IntoIter`. [breaking-change]
2015-02-06make `IndexMut` a super trait over `Index`Jorge Aparicio-2/+0
closes #21630
2015-02-07fix outdated docsAlexis-27/+27
Conflicts: src/libstd/collections/mod.rs
2015-02-06Rollup merge of #21969 - Gankro:collections-cleanup, r=alexcrichtonManish Goregaokar-124/+124
This is 99% burning ints to the ground, but I also got rid of useless annotations or made code more \"idiomatic\" as I went along. Mostly changes in tests.
2015-02-06Rollup merge of #21925 - sfackler:allow-missing-copy, r=alexcrichtonManish Goregaokar-2/+0
This was particularly helpful in the time just after OIBIT's implementation to make sure things that were supposed to be Copy continued to be, but it's now creates a lot of noise for types that intentionally don't want to be Copy. r? @alexcrichton
2015-02-05misc collections code cleanupAlexis-124/+124
2015-02-04stabilize core Entry APIAlexis-8/+8
2015-02-04Auto merge of #21892 - huonw:deprecate-rand, r=alexcrichtonbors-0/+1
Use [`rand`](https://crates.io/crates/rand) and [`derive_rand`](https://crates.io/crates/derive_rand) from crates.io. [breaking-change]
2015-02-03Switch missing_copy_implementations to default-allowSteven Fackler-2/+0
This was particularly helpful in the time just after OIBIT's implementation to make sure things that were supposed to be Copy continued to be, but it's now creates a lot of noise for types that intentionally don't want to be Copy.
2015-02-04Deprecate in-tree `rand`, `std::rand` and `#[derive(Rand)]`.Huon Wilson-0/+1
Use the crates.io crate `rand` (version 0.1 should be a drop in replacement for `std::rand`) and `rand_macros` (`#[derive_Rand]` should be a drop-in replacement). [breaking-change]
2015-02-03Auto merge of #21745 - chris-morgan:add-missing-unstable-attributes, r=huonwbors-0/+5
I’d kind of like to be able to use HashState in AnyMap, which I can’t do without a stability attribute on it. While I was at it I looked around and found a few more missing.
2015-02-02rollup merge of #21842: alexcrichton/issue-21839Alex Crichton-16/+6
Now that associated types are fully implemented the iterator adaptors only need type parameters which are associated with actual storage. All other type parameters can either be derived from these (e.g. they are an associated type) or can be bare on the `impl` block itself. This is a breaking change due to the removal of type parameters on these iterator adaptors, but code can fairly easily migrate by just deleting the relevant type parameters for each adaptor. Other behavior should not be affected. Closes #21839 [breaking-change]
2015-02-02remove unused mut qualifiersJorge Aparicio-3/+3
2015-02-02`for x in xs.iter()` -> `for x in &xs`Jorge Aparicio-5/+5
2015-02-02impl IntoIterator for HashSetJorge Aparicio-1/+27
2015-02-02impl IntoIterator for HashMapJorge Aparicio-1/+37
2015-02-01std: Remove extra type params on iter adaptorsAlex Crichton-16/+6
Now that associated types are fully implemented the iterator adaptors only need type parameters which are associated with actual storage. All other type parameters can either be derived from these (e.g. they are an associated type) or can be bare on the `impl` block itself. This is a breaking change due to the removal of type parameters on these iterator adaptors, but code can fairly easily migrate by just deleting the relevant type parameters for each adaptor. Other behavior should not be affected. Closes #21839 [breaking-change]
2015-02-01Auto merge of #21811 - tbu-:pr_more_isize, r=alexcrichtonbors-2/+2
Remove more `isize` stuff. Also fix the manual a bit about integer inference.
2015-01-31make Send/Sync impl of RawTable manualAlexis-12/+14
2015-01-31Kill more `isize`sTobias Bucher-2/+2
2015-01-30rollup merge of #21631: tbu-/isize_policeAlex Crichton-89/+89
Conflicts: src/libcoretest/iter.rs
2015-01-30smoke out remaining bugsJorge Aparicio-2/+1
2015-01-30fix testsJorge Aparicio-0/+1
2015-01-30fix falloutJorge Aparicio-2/+2
2015-01-30Add a few missing stability markers.Chris Morgan-0/+5
2015-01-30Remove all `i` suffixesTobias Bucher-89/+89
2015-01-29fix inference falloutJorge Aparicio-6/+6
2015-01-29convert remaining `range(a, b)` to `a..b`Jorge Aparicio-1/+1
2015-01-29`for x in range(a, b)` -> `for x in a..b`Jorge Aparicio-27/+27
sed -i 's/in range(\([^,]*\), *\([^()]*\))/in \1\.\.\2/g' **/*.rs
2015-01-29`range(a, b).foo()` -> `(a..b).foo()`Jorge Aparicio-3/+3
sed -i 's/ range(\([^,]*\), *\([^()]*\))\./ (\1\.\.\2)\./g' **/*.rs
2015-01-25Merge remote-tracking branch 'rust-lang/master'Brian Anderson-34/+34
Conflicts: mk/tests.mk src/liballoc/arc.rs src/liballoc/boxed.rs src/liballoc/rc.rs src/libcollections/bit.rs src/libcollections/btree/map.rs src/libcollections/btree/set.rs src/libcollections/dlist.rs src/libcollections/ring_buf.rs src/libcollections/slice.rs src/libcollections/str.rs src/libcollections/string.rs src/libcollections/vec.rs src/libcollections/vec_map.rs src/libcore/any.rs src/libcore/array.rs src/libcore/borrow.rs src/libcore/error.rs src/libcore/fmt/mod.rs src/libcore/iter.rs src/libcore/marker.rs src/libcore/ops.rs src/libcore/result.rs src/libcore/slice.rs src/libcore/str/mod.rs src/libregex/lib.rs src/libregex/re.rs src/librustc/lint/builtin.rs src/libstd/collections/hash/map.rs src/libstd/collections/hash/set.rs src/libstd/sync/mpsc/mod.rs src/libstd/sync/mutex.rs src/libstd/sync/poison.rs src/libstd/sync/rwlock.rs src/libsyntax/feature_gate.rs src/libsyntax/test.rs
2015-01-23grandfathered -> rust1Brian Anderson-92/+92
2015-01-23Set unstable feature names appropriatelyBrian Anderson-18/+18
* `core` - for the core crate * `hash` - hashing * `io` - io * `path` - path * `alloc` - alloc crate * `rand` - rand crate * `collections` - collections crate * `std_misc` - other parts of std * `test` - test crate * `rustc_private` - everything else
2015-01-21Remove 'since' from unstable attributesBrian Anderson-18/+18
2015-01-21Tie stability attributes to feature gatesBrian Anderson-1/+0
2015-01-21Add 'feature' and 'since' to stability attributesBrian Anderson-110/+124
2015-01-21rollup merge of #21457: alexcrichton/issue-21436Alex Crichton-11/+11
Conflicts: src/liballoc/boxed.rs src/librustc/middle/traits/error_reporting.rs src/libstd/sync/mpsc/mod.rs