about summary refs log tree commit diff
path: root/src/libcollections
AgeCommit message (Collapse)AuthorLines
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.
2015-06-11Conver reborrows to .iter() calls where appropriateJoshua Landau-1/+1
2015-06-11Auto merge of #26154 - pmarcelll:master, r=Gankrobors-17/+17
Various methods in both libcore/char.rs and librustc_unicode/char.rs were previously marked with #[inline], now every method is marked in char's impl blocks. Partially fixes #26124. EDIT: I'm not familiar with pull reqests (yet), apparently Github added my second commit to thit PR... Fixes #26124
2015-06-11Auto merge of #26122 - bluss:borrow-box, r=alexcrichtonbors-1/+9
Implement Borrow<T> and BorrowMut<T> for Box<T: ?Sized>
2015-06-11Auto merge of #25839 - bluss:str-split-at-impl, r=alexcrichtonbors-45/+72
Implement RFC rust-lang/rfcs#1123 Add str method str::split_at(mid: usize) -> (&str, &str). Also a minor cleanup in the collections::str module. Remove redundant slicing of self.
2015-06-10Removed many pointless calls to *iter() and iter_mut()Joshua Landau-17/+17
2015-06-10Rollup merge of #26164 - tafia:early-dedup, r=GankroManish Goregaokar-1/+1
No need to dedup if there is only 1 element in the vec, can early return
2015-06-10Rollup merge of #26146 - steveklabnik:remove_unsafe_pointer, r=GankroManish Goregaokar-3/+3
Using two terms for one thing is confusing, these are called 'raw pointers' today.
2015-06-10collections: Remove redundant slicing for strUlrik Sverdrup-45/+45
This is a remnant from a previous implementation of the str methods. Using `self` is fine now.
2015-06-10Add str::split_atUlrik Sverdrup-0/+27
Implement RFC rust-lang/rfcs#1123 Add str method str::split_at(mid: usize) -> (&str, &str).
2015-06-10Auto merge of #26130 - steveklabnik:gh25986, r=alexcrichtonbors-3/+28
This can be confusing when whitespace is the separator Fixes #25986
2015-06-10early return if 1 elementJohann Tuffe-1/+1
No need to dedup if there is only 1 element in the vec, can early return
2015-06-10Modify String::push to reallocate more conservatively in case of the ↵marcell-17/+17
character's UTF-8 representation is bigger than 1 byte
2015-06-09Exise 'unsafe pointer' in favor of 'raw pointer'Steve Klabnik-3/+3
Using two terms for one thing is confusing, these are called 'raw pointers' today.
2015-06-09Auto merge of #26039 - SimonSapin:case-mapping, r=alexcrichtonbors-3/+32
* Add “complex” mappings to `char::to_lowercase` and `char::to_uppercase`, making them yield sometimes more than on `char`: #25800. `str::to_lowercase` and `str::to_uppercase` are affected as well. * Add `char::to_titlecase`, since it’s the same algorithm (just different data). However this does **not** add `str::to_titlecase`, as that would require UAX#29 Unicode Text Segmentation which we decided not to include in of `std`: https://github.com/rust-lang/rfcs/pull/1054 I made `char::to_titlecase` immediately `#[stable]`, since it’s so similar to `char::to_uppercase` that’s already stable. Let me know if it should be `#[unstable]` for a while. * Add a special case for upper-case Sigma in word-final position in `str::to_lowercase`: #26035. This is the only language-independent conditional mapping currently in `SpecialCasing.txt`. * Stabilize `str::to_lowercase` and `str::to_uppercase`. The `&self -> String` on `str` signature seems straightforward enough, and the only relevant issue I’ve found is #24536 about naming. But `char` already has stable methods with the same name, and deprecating them for a rename doesn’t seem worth it. r? @alexcrichton
2015-06-09Document str::split behavior with contiguous separatorsSteve Klabnik-3/+28
This can be confusing when whitespace is the separator Fixes #25986
2015-06-09Implement Borrow<T> and BorrowMut<T> for Box<T: ?Sized>Ulrik Sverdrup-1/+9