about summary refs log tree commit diff
path: root/src/libstd/collections/hash/set.rs
AgeCommit message (Collapse)AuthorLines
2015-08-15std: Add issues to all unstable featuresAlex Crichton-3/+6
2015-07-27Show appropriate feature flags in docsSteve Klabnik-2/+4
2015-06-17std: Split the `std_misc` featureAlex Crichton-6/+8
2015-06-10Removed many pointless calls to *iter() and iter_mut()Joshua Landau-5/+5
2015-05-17Make debug builders take &mut self, add entries methodSteven Fackler-1/+1
[breaking-change]
2015-05-03Fix Derive Notice for HashSetPascal Hertleif-2/+2
2015-05-03Clean up HashSet ExamplesPascal Hertleif-5/+5
2015-05-03HashSet Docs: Split First ParagraphPascal Hertleif-4/+6
This way, the module index renders only the first sentence as a short description.
2015-04-21rollup merge of #24541: alexcrichton/issue-24538Alex Crichton-29/+24
This is an implementation of [RFC 1030][rfc] which adds these traits to the prelude and additionally removes all inherent `into_iter` methods on collections in favor of the trait implementation (which is now accessible by default). [rfc]: https://github.com/rust-lang/rfcs/pull/1030 This is technically a breaking change due to the prelude additions and removal of inherent methods, but it is expected that essentially no code breaks in practice. [breaking-change] Closes #24538
2015-04-21Model lexer: Fix remaining issuesPiotr Czarnecki-2/+0
2015-04-17std: Add Default/IntoIterator/ToOwned to the preludeAlex Crichton-29/+24
This is an implementation of [RFC 1030][rfc] which adds these traits to the prelude and additionally removes all inherent `into_iter` methods on collections in favor of the trait implementation (which is now accessible by default). [rfc]: https://github.com/rust-lang/rfcs/pull/1030 This is technically a breaking change due to the prelude additions and removal of inherent methods, but it is expected that essentially no code breaks in practice. [breaking-change] Closes #24538
2015-04-14Positive case of `len()` -> `is_empty()`Tamir Duberstein-1/+1
`s/(?<!\{ self)(?<=\.)len\(\) == 0/is_empty()/g`
2015-04-13pluralize doc comment verbs and add missing periodsAndrew Paseltiner-5/+5
2015-04-07std: Deny most warnings in doctestsAlex Crichton-8/+0
Allow a few specific ones but otherwise this helps ensure that our examples are squeaky clean! Closes #18199
2015-03-31std: Remove #[old_orphan_check] from PartialEqAlex Crichton-1/+1
This is a deprecated attribute that is slated for removal, and it also affects all implementors of the trait. This commit removes the attribute and fixes up implementors accordingly. The primary implementation which was lost was the ability to compare `&[T]` and `Vec<T>` (in that order). This change also modifies the `assert_eq!` macro to not consider both directions of equality, only the one given in the left/right forms to the macro. This modification is motivated due to the fact that `&[T] == Vec<T>` no longer compiles, causing hundreds of errors in unit tests in the standard library (and likely throughout the community as well). cc #19470 [breaking-change]
2015-03-29Rollup merge of #23814 - steveklabnik:gh23320, r=alexcrichtonManish Goregaokar-1/+10
Fixes #23320
2015-03-29Auto merge of #23810 - sfackler:debug-collections, r=alexcrichtonbors-8/+1
The collections debug helpers no longer prefix output with the collection name, in line with the current conventions for Debug implementations. Implementations that want to preserve the current behavior can simply add a `try!(write!(fmt, "TypeName "));` at the beginning of the `fmt` method. [breaking-change]
2015-03-28Remove IteratorExtSteven Fackler-3/+1
All methods are inlined into Iterator with `Self: Sized` bounds to make sure Iterator is still object safe. [breaking-change]
2015-03-28Document properties for Eq + HashSteve Klabnik-1/+10
Fixes #23320
2015-03-28Fold collections debug implsSteven Fackler-5/+1
Also convert [T]'s Debug impl. The behavior of the alternate flag here's changing.
2015-03-28Update debug helpers and add list builderSteven Fackler-7/+4
The collections debug helpers no longer prefix output with the collection name, in line with the current conventions for Debug implementations. Implementations that want to preserve the current behavior can simply add a `try!(write!(fmt, "TypeName "));` at the beginning of the `fmt` method. [breaking-change]
2015-03-23rollup merge of #23598: brson/gateAlex Crichton-0/+10
Conflicts: src/compiletest/compiletest.rs src/libcollections/lib.rs src/librustc_back/lib.rs src/libserialize/lib.rs src/libstd/lib.rs src/libtest/lib.rs src/test/run-make/rustdoc-default-impl/foo.rs src/test/run-pass/env-home-dir.rs
2015-03-23Add #![feature] attributes to doctestsBrian Anderson-0/+10
2015-03-23implement `Clone` for various iteratorsAndrew Paseltiner-0/+25
2015-03-16document undefined collection behavior with interior mutabilityAndrew Paseltiner-0/+6
closes #23327
2015-03-11Example -> ExamplesSteve Klabnik-23/+23
This brings comments in line with https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-conventions.md#using-markdown
2015-02-24Modify collection's `Debug` output to resemble in their content onlyTobias Bucher-3/+3
2015-02-18rollup merge of #22210: aturon/stab-final-borrowAlex Crichton-3/+3
Conflicts: src/libcollections/btree/map.rs src/libcollections/str.rs src/libcollections/vec.rs src/libcore/borrow.rs src/libcore/hash/mod.rs src/libstd/collections/hash/map.rs src/libstd/collections/hash/set.rs
2015-02-18Stabilize std::borrowAaron Turon-3/+3
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-2/+3
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-1/+2
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-1/+1
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-73/+48
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-17Register new snapshotsAlex Crichton-30/+0
2015-02-17std: Stabilize the IntoIterator traitAlex Crichton-0/+2
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/+32
`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/+32
2015-02-13more int and cloned cleanup in collectionsAlexis-24/+24
2015-02-09std: Rename IntoIterator::Iter to IntoIterAlex Crichton-2/+2
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-07fix outdated docsAlexis-11/+11
Conflicts: src/libstd/collections/mod.rs
2015-02-05misc collections code cleanupAlexis-33/+33
2015-02-02rollup merge of #21842: alexcrichton/issue-21839Alex Crichton-2/+2
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-1/+1
2015-02-02`for x in xs.iter()` -> `for x in &xs`Jorge Aparicio-3/+3
2015-02-02impl IntoIterator for HashSetJorge Aparicio-1/+27
2015-02-01std: Remove extra type params on iter adaptorsAlex Crichton-2/+2
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-01-31Kill more `isize`sTobias Bucher-2/+2
2015-01-30Remove all `i` suffixesTobias Bucher-31/+31
2015-01-29fix inference falloutJorge Aparicio-2/+2
2015-01-29convert remaining `range(a, b)` to `a..b`Jorge Aparicio-1/+1