about summary refs log tree commit diff
path: root/src/libcollections
AgeCommit message (Collapse)AuthorLines
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
2015-07-05Rollup merge of #26806 - cmr:stabilize-drain, r=GankroSteve Klabnik-14/+14
None
2015-07-05Rollup merge of #26464 - Gankro:send, r=alexcrichtonSteve Klabnik-3/+0
Vec contains `Unique<T>` and some usizes, this is already derived.
2015-07-05collections: vec_deque: add some notes on how to use VecDeque as a queue ↵Corey Richardson-0/+4
effectively
2015-07-05collections: vec_deque: rename "ringbuf" to "VecDeque" in doc commentsCorey Richardson-14/+14
2015-07-04str: Correct documentation on is_char_boundaryUlrik Sverdrup-3/+1
Documentation claims it panics on out of bounds -- it regards out of bounds as just not a char boundary. core::str module is aware of how it works and uses it appropriately. Maybe we should rename it to `is_valid_index`, `is_slicable_index`, or something similar.
2015-07-03remove some feature gates from the docsSteve Klabnik-4/+0
These aren't actually needed
2015-07-02Add more description for from_raw_parts's unsafetySteve Klabnik-3/+18
Fixes #26737.
2015-07-01Auto merge of #26034 - Gankro:deprecate-bits, r=alexcrichtonbors-0/+9
I've mirrored them out to crates (bit-vec and bit-set) that build on stable. (not sure if this actually correctly deprecates them in std)
2015-07-01fallout of bitvec/bitset deprecationAlexis Beingessner-1/+5
2015-06-30Rollup merge of #26678 - bluss:doc-fmt, r=steveklabnikSteve Klabnik-22/+23
fmt: Update docs and mention :#? pretty-printing Expose `:#?` well in the docs for fmt and Debug itself. Also update some out of date information and fix formatting in `std::fmt` docs.
2015-06-30Deprecate BitSet and BitVec in favour of bit-vec and bit-set crates in cargoAlexis Beingessner-0/+5
2015-06-30fmt: Update docs and mention :#? pretty-printingUlrik Sverdrup-22/+23
2015-06-26Auto merge of #25646 - huonw:align, r=alexcrichtonbors-16/+16
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.
2015-06-24Avoid overflow in Vec::from_iterSteven Fackler-2/+3
Closes #26550
2015-06-24Make `align_of` behave like `min_align_of`.Huon Wilson-16/+16
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.
2015-06-20remove redundant Send and Sync impl from VecAlexis Beingessner-3/+0
2015-06-17std: Stabilize vec_map::Entry::or_insert{,_with}Alex Crichton-8/+7
These functions mirror the other Entry APIs of other maps, and were mistakenly just not stabilized the first time around.
2015-06-17More test fixes and fallout of stability changesAlex Crichton-10/+18
2015-06-17std: Stabilize the `str_matches` featureAlex Crichton-6/+4
This commit stabilizes the `str::{matches, rmatches}` functions and iterators, but renames the unstable feature for the `str::{matches,rmatches}_indices` function to `str_match_indices` due to the comment present on the functions about the iterator's return value.
2015-06-17std: Deprecate Vec::from_raw_bufAlex Crichton-0/+2
This function is more naturally expressed as slice::from_raw_buf plus a call to to_vec.
2015-06-17std: Deprecate all permutation-related slice methodsAlex Crichton-0/+6
These methods have been unstable for quite some time, and it's not clear that these should remain in the standard library.
2015-06-17Fallout in tests and docs from feature renamingsAlex Crichton-118/+120
2015-06-17std: Split the `std_misc` featureAlex Crichton-1/+1
2015-06-17collections: Split the `collections` featureAlex Crichton-133/+148
This commit also deprecates the `as_string` and `as_slice` free functions in the `string` and `vec` modules.
2015-06-17alloc: Split apart the global `alloc` featureAlex Crichton-0/+3
2015-06-17core: Split apart the global `core` featureAlex Crichton-7/+23
This commit shards the broad `core` feature of the libcore library into finer grained features. This split groups together similar APIs and enables tracking each API separately, giving a better sense of where each feature is within the stabilization process. A few minor APIs were deprecated along the way: * Iterator::reverse_in_place * marker::NoCopy
2015-06-17Auto merge of #22681 - mzabaluev:extend-faster, r=huonwbors-39/+39
Instead of a fast branch with a sized iterator falling back to a potentially poorly optimized iterate-and-push loop, a single efficient loop can serve all cases. In my benchmark runs, I see some good gains, but also some regressions, possibly due to different inlining choices by the compiler. YMMV.
2015-06-11Auto merge of #26190 - Veedrac:no-iter, r=alexcrichtonbors-18/+18
Pull request for #26188.