summary refs log tree commit diff
path: root/src/libcollections
AgeCommit message (Collapse)AuthorLines
2015-07-30Auto merge of #26734 - Gankro:deprecate-vecmap, r=alexcrichtonbors-2/+7
VecMap doesn't really fit with the current standard library's strategy (small!). I've mirrored the code to https://github.com/contain-rs/vec-map but @GBGamer has already claimed the name on crates.io a couple months ago for the same purpose. It hasn't been updated since, though. CC @rust-lang/libs
2015-07-29deprecate vecmapAlexis Beingessner-2/+7
2015-07-30Rollup merge of #27352 - nagisa:illegal-to-invalid-docs, r=steveklabnikManish Goregaokar-9/+11
r? @steveklabnik
2015-07-29Auto merge of #27380 - steveklabnik:rollup, r=steveklabnikbors-143/+273
- Successful merges: #27102, #27286, #27313, #27325, #27326, #27327, #27341, #27342, #27343, #27345, #27350, #27355, #27374, #27375, #27379 - Failed merges:
2015-07-29Rollup merge of #27375 - niconii:vec-docs, r=GankroSteve Klabnik-1/+8
Noticed that syntax like `vec![0; 5]` is never mentioned in `Vec<T>`'s docs, nor used in any of its methods' docs, so I figured I should add a mention of it. Also noticed `vec!(1, 2)` being used in one spot while I was at it, so I fixed that as well for consistency's sake. r? @steveklabnik
2015-07-29Rollup merge of #27326 - steveklabnik:doc_show_use, r=GankroSteve Klabnik-123/+242
In spirit with https://internals.rust-lang.org/t/should-we-keep-including-obvious-imports-in-code-examples/2217, show the feature flags we're using in examples. (also one instance of 'use')
2015-07-29Rollup merge of #27102 - tshepang:better-examples, r=aturonSteve Klabnik-19/+23
2015-07-28Make docs for Vec::push() use vec! with square bracketsNicolette Verlinden-1/+1
2015-07-28Mention vec![x; len] syntax in Vec docsNicolette Verlinden-0/+7
2015-07-28libcollections: Inline some performance-critical string functions; e.g.Patrick Walton-0/+17
`chars()`. This was showing up in Servo profiles.
2015-07-28Replace occurences of illegal in user facing docsSimonas Kazlauskas-9/+11
2015-07-28Auto merge of #26914 - alexcrichton:deprecate-easy, r=aturonbors-0/+15
Many of these have long since reached their stage of being obsolete, so this commit starts the removal process for all of them. The unstable features that were deprecated are: * box_heap * cmp_partial * fs_time * hash_default * int_slice * iter_min_max * iter_reset_fuse * iter_to_vec * map_in_place * move_from * owned_ascii_ext * page_size * read_and_zero * scan_state * slice_chars * slice_position_elem * subslice_offset
2015-07-27std: Deprecate a number of unstable featuresAlex Crichton-0/+15
Many of these have long since reached their stage of being obsolete, so this commit starts the removal process for all of them. The unstable features that were deprecated are: * cmp_partial * fs_time * hash_default * int_slice * iter_min_max * iter_reset_fuse * iter_to_vec * map_in_place * move_from * owned_ascii_ext * page_size * read_and_zero * scan_state * slice_chars * slice_position_elem * subslice_offset
2015-07-27Show appropriate feature flags in docsSteve Klabnik-123/+242
2015-07-25Document Unicode complications in chars iteratorKornel Lesiński-47/+71
2015-07-22Auto merge of #27172 - alexcrichton:snapshots, r=brsonbors-10/+0
Enables bootstrapping a 32-bit MSVC host compiler! Closes #26602
2015-07-20std: Create separate docs for the primitivesBrian Anderson-36/+4
Having the primitive and module docs derived from the same source causes problems, primarily that they can't contain hyperlinks cross-referencing each other. This crates dedicated private modules in `std` to document the primitive types, then for all primitives that have a corresponding module, puts hyperlinks in moth the primitive docs and the module docs cross-linking each other. This should help clear up confusion when readers find themselves on the wrong page.
2015-07-20doc: Clean up primitive short descriptionsBrian Anderson-2/+2
This makes the primitive descriptions on the front page read properly as descriptions of types and not of the associated modules.
2015-07-20Register new snapshotsAlex Crichton-10/+0
These new snapshots contain the knowledge of how to build the new triples of 32-bit MSVC and 32-bit FreeBSD, both of which should soon start having nightlies/auto builders! This does not currently register bitrig/freebsd snapshots but I believe those will be retroactively added in the near future.
2015-07-19Auto merge of #27100 - tshepang:better-names, r=Gankrobors-38/+38
2015-07-19doc: use 'index' and 'value' in place of 'i' and 't'Tshepang Lekhonkhobe-38/+38
2015-07-18'Copies' => 'Clones' in Cow method docs.Nick Hamann-2/+2
It seems slightly more consistent to say 'Clones' here instead of 'Copies'. The docs for the `ToOwned` trait talk about cloning and not copying.
2015-07-17Auto merge of #26955 - Gankro:raw-vec, r=bluss,alexcrichtonbors-444/+175
Per the top level comment: A low-level utility for more ergonomically allocating, reallocating, and deallocating a a buffer of memory on the heap without having to worry about all the corner cases involved. This type is excellent for building your own data structures like Vec and VecDeque. In particular: * Produces heap::EMPTY on zero-sized types * Produces heap::EMPTY on zero-length allocations * Catches all overflows in capacity computations (promotes them to "capacity overflow" panics) * Guards against 32-bit systems allocating more than isize::MAX bytes * Guards against overflowing your length * Aborts on OOM * Avoids freeing heap::EMPTY * Contains a ptr::Unique and thus endows the user with all related benefits This type does not in anyway inspect the memory that it manages. When dropped it *will* free its memory, but it *won't* try to Drop its contents. It is up to the user of RawVec to handle the actual things *stored* inside of a RawVec. Note that a RawVec always forces its capacity to be usize::MAX for zero-sized types. This enables you to use capacity growing logic catch the overflows in your length that might occur with zero-sized types. However this means that you need to be careful when roundtripping this type with a `Box<[T]>`: `cap()` won't yield the len. However `with_capacity`, `shrink_to_fit`, and `from_box` will actually set RawVec's private capacity field. This allows zero-sized types to not be special-cased by consumers of this type. Edit: fixes #18726 and fixes #23842
2015-07-17doc: improve some VecDeque examplesTshepang Lekhonkhobe-19/+23
2015-07-18Rollup merge of #27095 - tshepang:space, r=alexcrichtonManish Goregaokar-1/+1
2015-07-17doc: add missing spaceTshepang Lekhonkhobe-1/+1
2015-07-17Add RawVec to unify raw Vecish codeAlexis Beingessner-444/+175
2015-07-17Update vec.rsWei-Ming Yang-0/+1
improve the 'Unsafety' section of `collections::vec::Vec::<T>::from_raw_parts`.
2015-07-13Auto merge of #26241 - SimonSapin:derefmut-for-string, r=alexcrichtonbors-1/+57
See https://github.com/rust-lang/rfcs/issues/1157
2015-07-13Fix tests for changes in #26241.Simon Sapin-1/+1
2015-07-13Mark some new things as unstable.Simon Sapin-1/+3
2015-07-13Add str::split_at_mutSimon Sapin-0/+6
2015-07-13Implement IndexMut for String and str.Simon Sapin-0/+40
... matching the existing Index impls. There is no reason not to if String implement DerefMut. The code removed in `src/librustc/middle/effect.rs` was added in #9750 to prevent things like `s[0] = 0x80` where `s: String`, but I belive became unnecessary when the Index(Mut) traits were introduced.
2015-07-13Implement DerefMut for StringSimon Sapin-0/+8
`&mut str` is rarely useful, but it is for e.g. `AsciiExt::make_ascii_lowercase`.
2015-07-12Auto merge of #26957 - wesleywiser:rename_connect_to_join, r=alexcrichtonbors-2/+22
Fixes #26900
2015-07-12Auto merge of #26966 - nagisa:tail-init, r=alexcrichtonbors-4/+35
Fixes #26906
2015-07-11Add String::into_boxed_slice and Box<str>::into_stringJonathan Reem-21/+23
Implements merged RFC 1152. Closes #26697.
2015-07-12Implement RFC 1058Simonas Kazlauskas-4/+35
2015-07-11Auto merge of #26878 - Esption:master, r=pnkfelixbors-1/+1
I noticed in docs, specifically http://doc.rust-lang.org/std/primitive.u8.html#method.is_power_of_two, that it was like this, and it was apparently in multiple places too. Didn't change any occurrences through the cross-depo things. There's a lot in /src/llvm/ for instance, but I'm not confident on how to go about sending fixes for those, so this is just what's in the base rust depo. r? @steveklabnik
2015-07-11Fix feature nameWesley Wiser-1/+1
2015-07-11Fix version number on SliceConcatExt:joinWesley Wiser-1/+1
2015-07-10Rename SliceConcatExt::connect to join #26900Wesley Wiser-2/+22
2015-07-09Auto merge of #26904 - bluss:no-repeat, r=alexcrichtonbors-1/+1
In a followup to PR #26849, improve one more location for I/O where we can use `Vec::resize` to ensure better performance when zeroing buffers. Use the `vec![elt; n]` macro everywhere we can in the tree. It replaces `repeat(elt).take(n).collect()` which is more verbose, requires type hints, and right now produces worse code. `vec![]` is preferable for vector initialization. The `vec![]` replacement touches upon one I/O path too, Stdin::read for windows, and that should be a small improvement. r? @alexcrichton
2015-07-09Use vec![elt; n] where possibleUlrik Sverdrup-1/+1
The common pattern `iter::repeat(elt).take(n).collect::<Vec<_>>()` is exactly equivalent to `vec![elt; n]`, do this replacement in the whole tree. (Actually, vec![] is smart enough to only call clone n - 1 times, while the former solution would call clone n times, and this fact is virtually irrelevant in practice.)
2015-07-08'iff' for docs to 'if and only if'Esption-1/+1
2015-07-08Auto merge of #26869 - alexcrichton:fix-msvc-sepcomp, r=nrcbors-0/+1
This commit alters the implementation of multiple codegen units slightly to be compatible with the MSVC linker. Currently the implementation will take the N object files created by each codegen unit and will run `ld -r` to create a new object file which is then passed along. The MSVC linker, however, is not able to do this operation. The compiler will now no longer attempt to assemble object files together but will instead just pass through all the object files as usual. This implies that rlibs may not contain more than one object file (if the library is compiled with more than one codegen unit) and the output of `-C save-temps` will have changed slightly as object files with the extension `0.o` will not be renamed to `o` unless requested otherwise.
2015-07-08trans: Link rlibs to dylibs with --whole-archiveAlex Crichton-0/+1
This commit starts passing the `--whole-archive` flag (`-force_load` on OSX) to the linker when linking rlibs into dylibs. The primary purpose of this commit is to ensure that the linker doesn't strip out objects from an archive when creating a dynamic library. Information on how this can go wrong can be found in issues #14344 and #25185. The unfortunate part about passing this flag to the linker is that we have to preprocess the rlib to remove the metadata and compressed bytecode found within. This means that creating a dylib will now take longer to link as we've got to copy around the input rlibs to a temporary location, modify them, and then invoke the linker. This isn't done for executables, however, so the "hello world" compile time is not affected. This fix was instigated because of the previous commit where rlibs may not contain multiple object files instead of one due to codegen units being greater than one. That change prevented the main distribution from being compiled with more than one codegen-unit and this commit fixes that. Closes #14344 Closes #25185
2015-07-08Improve Vec::resize so that it can be used in Read::read_to_endUlrik Sverdrup-21/+28
We needed a more efficient way to zerofill the vector in read_to_end. This to reduce the memory intialization overhead to a minimum. Use the implementation of `std::vec::from_elem` (used for the vec![] macro) for Vec::resize as well. For simple element types like u8, this compiles to memset, so it makes Vec::resize much more efficient.
2015-07-08Fixed some occurrences of 'if' being spelled 'iff'Esption-1/+1
2015-07-06Auto merge of #26817 - cmr:vecdeque-docs, r=Gankrobors-0/+4
None