about summary refs log tree commit diff
path: root/src/libcollections
AgeCommit message (Collapse)AuthorLines
2015-03-27Rollup merge of #23738 - alexcrichton:snapshots, r=cmrManish Goregaokar-226/+0
2015-03-27default => or_insert per RFCAlexis Beingessner-8/+8
2015-03-26update everything to use Entry defaultsAlexis-22/+4
2015-03-26entry API v3: replace Entry::get with Entry::default and Entry::default_withAlexis-1/+49
2015-03-26Register new snapshotsAlex Crichton-226/+0
2015-03-25Rollup merge of #23664 - bluss:std-docs, r=steveklabnikManish Goregaokar-42/+34
Main motivation was to update docs for the removal or "demotion" of certain extension traits. The update to the slice docs was larger, since the text was largely outdated.
2015-03-25Rollup merge of #23617 - steveklabnik:gh23564, r=ManishearthManish Goregaokar-0/+2
Fixes #23564
2015-03-25Auto merge of #23670 - cmr:vec-push-slowpath, r=pcwaltonbors-9/+16
Makes Vec::push considerably smaller: 25 instructions, rather than 42, on x86_64.
2015-03-24collections: Update docs for slice since SliceExt was removedUlrik Sverdrup-41/+33
A lot has changed since this doc text was last touched up, and this is just a minor edit. I remove the trait section entirely since we don't use extension traits that much anymore, so there are no significant trait hilights for this module.
2015-03-24core: Update docs for StrExt demotion in libstdUlrik Sverdrup-1/+1
Main access point of .split() and other similar methods are not using the StrExt trait anymore, so update the libcore docs to reflect this (because these docs are visible in libstd API documentation).
2015-03-24libcollections: move Vec::push slow path outCorey Richardson-9/+16
Makes Vec::push considerably smaller: 25 instructions, rather than 42, on x86_64.
2015-03-25Change lint names to pluralsNick Cameron-2/+2
2015-03-25Add trivial cast lints.Nick Cameron-2/+4
This permits all coercions to be performed in casts, but adds lints to warn in those cases. Part of this patch moves cast checking to a later stage of type checking. We acquire obligations to check casts as part of type checking where we previously checked them. Once we have type checked a function or module, then we check any cast obligations which have been acquired. That means we have more type information available to check casts (this was crucial to making coercions work properly in place of some casts), but it means that casts cannot feed input into type inference. [breaking change] * Adds two new lints for trivial casts and trivial numeric casts, these are warn by default, but can cause errors if you build with warnings as errors. Previously, trivial numeric casts and casts to trait objects were allowed. * The unused casts lint has gone. * Interactions between casting and type inference have changed in subtle ways. Two ways this might manifest are: - You may need to 'direct' casts more with extra type information, for example, in some cases where `foo as _ as T` succeeded, you may now need to specify the type for `_` - Casts do not influence inference of integer types. E.g., the following used to type check: ``` let x = 42; let y = &x as *const u32; ``` Because the cast would inform inference that `x` must have type `u32`. This no longer applies and the compiler will fallback to `i32` for `x` and thus there will be a type error in the cast. The solution is to add more type information: ``` let x: u32 = 42; let y = &x as *const u32; ```
2015-03-23Test fixes and rebase conflicts, round 2Alex Crichton-12/+20
2015-03-23rollup merge of #23598: brson/gateAlex Crichton-1/+164
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-23rollup merge of #23648: steveklabnik/rollupAlex Crichton-15/+17
- Successful merges: #22954, #23119, #23509, #23561, #23590, #23607, #23608, #23618, #23622, #23639, #23641 - Failed merges: #23401
2015-03-23rollup merge of #23637: apasel422/iterAlex Crichton-1/+8
2015-03-23rollup merge of #23604: apasel422/btreeAlex Crichton-0/+41
`btree_map::IntoIter` (and `btree_set::IntoIter`) remains, but it is a bit trickier.
2015-03-23rollup merge of #23601: nikomatsakis/by-value-indexAlex Crichton-3/+259
This is a [breaking-change]. When indexing a generic map (hashmap, etc) using the `[]` operator, it is now necessary to borrow explicitly, so change `map[key]` to `map[&key]` (consistent with the `get` routine). However, indexing of string-valued maps with constant strings can now be written `map["abc"]`. r? @japaric cc @aturon @Gankro
2015-03-23rollup merge of #23580: nikomatsakis/pattern-and-overflowAlex Crichton-0/+20
2015-03-23rollup merge of #23538: aturon/conversionAlex Crichton-30/+96
Conflicts: src/librustc_back/rpath.rs
2015-03-23rollup merge of #23269: shepmaster/split-not-double-endedAlex Crichton-9/+36
Closes #23262
2015-03-23Remove auto-deref'ing Pattern impl because it conflicts with otherNiko Matsakis-0/+20
possible blanket impls and also triggers internal overflow. Add some special cases for common uses (&&str, &String) for now; bounds-targeting deref coercions are probably the right longer term answer.
2015-03-23Add generic conversion traitsAaron Turon-30/+96
This commit: * Introduces `std::convert`, providing an implementation of RFC 529. * Deprecates the `AsPath`, `AsOsStr`, and `IntoBytes` traits, all in favor of the corresponding generic conversion traits. Consequently, various IO APIs now take `AsRef<Path>` rather than `AsPath`, and so on. Since the types provided by `std` implement both traits, this should cause relatively little breakage. * Deprecates many `from_foo` constructors in favor of `from`. * Changes `PathBuf::new` to take no argument (creating an empty buffer, as per convention). The previous behavior is now available as `PathBuf::from`. * De-stabilizes `IntoCow`. It's not clear whether we need this separate trait. Closes #22751 Closes #14433 [breaking-change]
2015-03-23Add #![feature] attributes to doctestsBrian Anderson-0/+163
2015-03-23Require feature attributes, and add them where necessaryBrian Anderson-1/+1
2015-03-23Rollup merge of #23509 - aturon:stab-entry, r=GankroSteve Klabnik-15/+17
This commit marks as `#[stable]` the `Entry` types for the maps provided by `std`. The main reason these had been left unstable previously was uncertainty about an eventual trait design, but several plausible designs have been proposed that all work fine with the current type definitions. r? @Gankro
2015-03-23Fallout in stdlib, rustdoc, rustc, etc. For most maps, converted uses ofNiko Matsakis-2/+63
`[]` on maps to `get` in rustc, since stage0 and stage1+ disagree about how to use `[]`.
2015-03-23Adjust Index/IndexMut impls. For generic collections, we takeNiko Matsakis-1/+184
references. For collections whose keys are integers, we take both references and by-value.
2015-03-23Compiler and trait changes to make indexing by value.Niko Matsakis-0/+12
2015-03-23document iteration order for `vec_deque::IntoIter`Andrew Paseltiner-1/+1
2015-03-23implement `ExactSizeIterator` for `linked_list::IntoIter`Andrew Paseltiner-0/+2
2015-03-23implement `Clone` for various iteratorsAndrew Paseltiner-0/+5
2015-03-23Rollup merge of #23559 - aturon:future-proof-map-index, r=GankroManish Goregaokar-10/+1
This commit removes the `IndexMut` impls on `HashMap` and `BTreeMap`, in order to future-proof the API against the eventual inclusion of an `IndexSet` trait. Ideally, we would eventually be able to support: ```rust map[owned_key] = val; map[borrowed_key].mutating_method(arguments); &mut map[borrowed_key]; ``` but to keep the design space as unconstrained as possible, we do not currently want to support `IndexMut`, in case some other strategy will eventually be needed. Code currently using mutating index notation can use `get_mut` instead. [breaking-change] Closes #23448 r? @Gankro
2015-03-22Note order of BinaryHeap::drainSteve Klabnik-0/+2
Fixes #23564
2015-03-21implement `Clone` for `btree` iteratorsAndrew Paseltiner-0/+41
2015-03-20std: Remove old_io/old_path from the preludeAlex Crichton-3/+4
This commit removes the reexports of `old_io` traits as well as `old_path` types and traits from the prelude. This functionality is now all deprecated and needs to be removed to make way for other functionality like `Seek` in the `std::io` module (currently reexported as `NewSeek` in the io prelude). Closes #23377 Closes #23378
2015-03-20Future-proof indexing on maps: remove IndexMutAaron Turon-10/+1
This commit removes the `IndexMut` impls on `HashMap` and `BTreeMap`, in order to future-proof the API against the eventual inclusion of an `IndexSet` trait. Ideally, we would eventually be able to support: ```rust map[owned_key] = val; map[borrowed_key].mutating_method(arguments); &mut map[borrowed_key]; ``` but to keep the design space as unconstrained as possible, we do not currently want to support `IndexMut`, in case some other strategy will eventually be needed. Code currently using mutating index notation can use `get_mut` instead. [breaking-change] Closes #23448
2015-03-19StrExt::splitn should not require a DoubleEndedSearcherJake Goulding-10/+9
Closes #23262
2015-03-19Introduce rsplitJake Goulding-2/+30
2015-03-18Stabilize Entry typesAaron Turon-15/+17
This commit marks as `#[stable]` the `Entry` types for the maps provided by `std`. The main reason these had been left unstable previously was uncertainty about an eventual trait design, but several plausible designs have been proposed that all work fine with the current type definitions.
2015-03-19Document {:.*}Steve Klabnik-5/+12
Fixes #22927
2015-03-19Small formatting fixes to fmt.rsSteve Klabnik-22/+23
2015-03-18Register new snapshotsAlex Crichton-2223/+16
2015-03-18Rollup merge of #23455 - Ryman:trim_matches_doc, r=steveklabnikManish Goregaokar-2/+2
2015-03-17std: Tweak some unstable features of `str`Alex Crichton-60/+108
This commit clarifies some of the unstable features in the `str` module by moving them out of the blanket `core` and `collections` features. The following methods were moved to the `str_char` feature which generally encompasses decoding specific characters from a `str` and dealing with the result. It is unclear if any of these methods need to be stabilized for 1.0 and the most conservative route for now is to continue providing them but to leave them as unstable under a more specific name. * `is_char_boundary` * `char_at` * `char_range_at` * `char_at_reverse` * `char_range_at_reverse` * `slice_shift_char` The following methods were moved into the generic `unicode` feature as they are specifically enabled by the `unicode` crate itself. * `nfd_chars` * `nfkd_chars` * `nfc_chars` * `graphemes` * `grapheme_indices` * `width`
2015-03-17Fix documentation for StrExt::trim_matchesKevin Butler-2/+2
2015-03-17Rollup merge of #23329 - jbcrail:rm-syntax-highlight, r=sanxiynManish Goregaokar-34/+34
As suggested by @steveklabnik in #23254, I removed the redundant Rust syntax highlighting from the documentation.
2015-03-16better document the hacks required to test libcollectionsJorge Aparicio-103/+133
2015-03-16fix after rebaseJorge Aparicio-0/+1