summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2013-07-16hashmap: Iterators for hashset diff, sym. diff, intersec, unionblake2-ppc-10/+70
Implement the difference, union, etc iterators with the help of a custom iterator combinator with explicit closure environment. Reported issue #7814 to be able to use the std::iterator filter combinator.
2013-07-16hashmap: Remove .mutate_values() which is replaced by .mut_iter()blake2-ppc-13/+0
2013-07-15std: add consuming iterators for `HashMap` and `HashSet`Andrew Paseltiner-0/+82
2013-07-15cmp: Use default methods in trait Eq, require only Eq::eqblake2-ppc-2/+4
2013-07-14auto merge of #7788 : MarkJr94/rust/from_iter, r=cmrbors-15/+115
Added Iterators for HashMap/Set, TreeMap/Set, TrieMap/Set, and PriorityQueue as per Issue #7626
2013-07-14Stripped trailing spaces; Implemented FromIterator for TreeMap and PriorityQueue=Mark Sinclair-6/+6
2013-07-14Make TLS keys actually take up spaceAlex Crichton-53/+58
If the TLS key is 0-sized, then the linux linker is apparently smart enough to put everything at the same pointer. OSX on the other hand, will reserve some space for all of them. To get around this, the TLS key now actuall consumes space to ensure that it gets a unique pointer
2013-07-14Purge the last remnants of the old TLS apiAlex Crichton-164/+213
Closes #3273
2013-07-14Implemented FromIterator for TrieMap and TrieSet=Mark Sinclair-14/+91
2013-07-14Implemented FromIterator for std::hashmap=Mark Sinclair-1/+24
2013-07-13Split mutable methods out of Set and MapSteven Fackler-28/+41
Fixes most of #4989. I didn't add Persistent{Set,Map} since the only persistent data structure is fun_treemap and its functionality is currently too limited to build a trait out of.
2013-07-13auto merge of #7765 : blake2-ppc/rust/ord-default-methods, r=huonwbors-8/+9
Rust will allow to supply default methods for all four methods, but we don't have any nice error reporting for the case where at least one method must be implemented, but it's arbitrary which. So in this case, we require `lt`, but allow implementing the others if needed.
2013-07-12auto merge of #7734 : alexcrichton/rust/issue-3395, r=sanxiynbors-2/+2
Also ends up fixing one case in libstd. Closes #3395
2013-07-13cmp: Use default methods in trait Ord, only require Ord::ltblake2-ppc-8/+9
It will be simpler to implement only one method for Ord, while we also allow implementing all four Ord methods for semantics or performance reasons. We only supply three default methods (and not four), because don't have any nice error reporting for the case where at least one method must be implemented, but it's arbitrary which.
2013-07-12auto merge of #7725 : msullivan/rust/default-methods, r=pcwaltonbors-1/+1
r?
2013-07-12auto merge of #7736 : thestinger/rust/doc, r=thestingerbors-22/+73
2b96408 r=sanxiyn documents conversion, size hints and double-ended iterators and adds more of the traits to the prelude
2013-07-12Account for possible 0-sized elements in vector iteratorsAlex Crichton-13/+68
Closes #7733
2013-07-12Remove the global 'vec::to_owned' functionAlex Crichton-6/+1
2013-07-12auto merge of #7696 : glinscott/rust/utf8_perf, r=cmrbors-36/+76
Moves multibyte code to it's own function to make char_range_at easier to inline, and faster for single and multibyte chars. Benchmarked reading example.json 100 times, 1.18s before, 1.08s after. Also, optimize str::is_utf8 for the single and multibyte case Before: is_utf8_ascii: 272.355162 ms is_utf8_multibyte: 167.337334 ms After: is_utf8_ascii: 218.088049 ms is_utf8_multibyte: 134.836722 ms
2013-07-12extend the iterator tutorialDaniel Micay-3/+4
documents conversion, size hints and double-ended iterators and adds more of the traits to the prelude
2013-07-11auto merge of #7677 : alexcrichton/rust/tls-gc, r=pcwaltonbors-243/+591
cc #6004 and #3273 This is a rewrite of TLS to get towards not requiring `@` when using task local storage. Most of the rewrite is straightforward, although there are two caveats: 1. Changing `local_set` to not require `@` is blocked on #7673 2. The code in `local_pop` is some of the most unsafe code I've written. A second set of eyes should definitely scrutinize it... The public-facing interface currently hasn't changed, although it will have to change because `local_data::get` cannot return `Option<T>`, nor can it return `Option<&T>` (the lifetime isn't known). This will have to be changed to be given a closure which yield `&T` (or as an Option). I didn't do this part of the api rewrite in this pull request as I figured that it could wait until when `@` is fully removed. This also doesn't deal with the issue of using something other than functions as keys, but I'm looking into using static slices (as mentioned in the issues).
2013-07-11Expand ctypes warnings to warn about *int/*uintAlex Crichton-2/+2
Also ends up fixing one case in libstd
2013-07-11Fix testsAlex Crichton-1/+1
2013-07-11Take default methods out from behind the flag.Michael Sullivan-1/+1
2013-07-11auto merge of #7707 : thestinger/rust/double, r=cmrbors-54/+87
00da76d r=cmr 6e75f2d r=cmr This implements the trait for vector iterators, replacing the reverse iterator types. The methods will stay, for implementing the future reverse Iterable traits and convenience. This can also be trivially implemented for circular buffers and other variants of arrays like strings. The `DoubleEndedIterator` trait will allow for implementing algorithms like in-place reverse on generic mutable iterators. The naming (`Range` vs. `Iterator`, `Bidirectional` vs. `DoubleEnded`) can be bikeshedded in the future.
2013-07-11Optimize is_utf8Gary Linscott-8/+16
Manually unroll the multibyte loops, and optimize for the single byte chars.
2013-07-11char_range_at perf workGary Linscott-28/+60
Moves multibyte code to it's own function to make char_range_at easier to inline, and faster for single and multibyte chars. Benchmarked reading example.json 100 times, 1.18s before, 1.08s after.
2013-07-11Fix #5270: another test I did not update properly.Felix S. Klock II-2/+2
2013-07-11auto merge of #7708 : bcully/rust/warnings, r=thestingerbors-1/+3
Just getting my feet wet.
2013-07-11auto merge of #7693 : korenchkin/rust/fixdoc_rand, r=cmrbors-19/+31
All of the examples were still using `core::` instead of `std::` and needed a `use std::rand;` at the top to compile Most of the examples had `rng = rand::rng();` instead of `let mut rng = rand::rng();`
2013-07-11Remove all external requirements of `@` from TLSAlex Crichton-16/+16
Closes #6004
2013-07-11Fix a soundness problem with `get`Alex Crichton-31/+79
2013-07-11Work around stage0 to remove '@' requirements from TLSAlex Crichton-75/+334
2013-07-10auto merge of #7691 : nikomatsakis/rust/vec-split-method, r=thestingerbors-1/+37
I don't think we have this yet. This makes `&mut [T]` much more flexible. r? @strcat (or whomever)
2013-07-11vec: rm inline(never) hackDaniel Micay-13/+2
just avoid giving an inline hint in the first place
2013-07-11iterator: add DoubleEndedIterator conceptDaniel Micay-41/+85
This implements the trait for vector iterators, replacing the reverse iterator types. The methods will stay, for implementing the future reverse Iterable traits and convenience. This can also be trivially implemented for circular buffers and other variants of arrays like strings and `SmallIntMap`/`SmallIntSet`. The `DoubleEndedIterator` trait will allow for implementing algorithms like in-place reverse on generic mutable iterators. The naming (`Range` vs. `Iterator`, `Bidirectional` vs. `DoubleEnded`) can be bikeshedded in the future.
2013-07-10remove unused importsBrendan Cully-1/+3
2013-07-10auto merge of #7690 : kevinmehall/rust/document-c_void, r=huonwbors-0/+7
I added documentation for when to use and not to use `c_void`, since it tripped me up when I started. (See issue #7627)
2013-07-10auto merge of #7683 : alexcrichton/rust/issue-7625, r=thestingerbors-2/+8
Closes #7625
2013-07-10Add a `mut_split()` method for dividing one `&mut [T]` into twoNiko Matsakis-1/+37
2013-07-10Fixed exampleskorenchkin-19/+31
The examples were still using `core::` instead of `std::` All of the examples needed a `use std::rand;` at the top to compile Most of the examples had `rng = rand::rng();` instead of `let mut rng = rand::rng();`
2013-07-10Document std::libc::c_void.Kevin Mehall-0/+7
2013-07-10Added overloaded Add and Sub traits for pointer arithmetic=Mark Sinclair-0/+96
Implemented ptr arithmetic for *T and *mut T. Tests passing
2013-07-10Merge pull request #7682 from thestinger/vecDaniel Micay-7/+26
vec::with_capacity: do one alloc for non-managed + ptr module improvements
2013-07-10Switch over to new range_rev semantics; fix #5270.Felix S. Klock II-8/+10
2013-07-10Refactored int/uint range code in preparation for change to range_rev semantics.Felix S. Klock II-33/+148
Also added unit tests of range code to test refactoring. The num-range-rev.rs test will need to be updated when the range_rev semantics change.
2013-07-10Don't loop infinitely on 0-size structs in reprAlex Crichton-2/+8
Closes #7625
2013-07-09ptr: optimize {swap,replace,read}_ptrDaniel Micay-6/+6
2013-07-09vec::with_capacity: do one alloc for non-managedDaniel Micay-1/+20
2013-07-09auto merge of #7265 : brson/rust/io-upstream, r=brsonbors-2033/+5384
r? @graydon, @nikomatsakis, @pcwalton, or @catamorphism Sorry this is so huge, but it's been accumulating for about a month. There's lots of stuff here, mostly oriented toward enabling multithreaded scheduling and improving compatibility between the old and new runtimes. Adds task pinning so that we can create the 'platform thread' in servo. [Here](https://github.com/brson/rust/blob/e1555f9b5628af2b6c6ed344cad621399cb7684d/src/libstd/rt/mod.rs#L201) is the current runtime setup code. About half of this has already been reviewed.