summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2013-07-18librustc: Forbid `&` pointers (other than `&'static`) inside `@` boxes.Patrick Walton-5/+5
This makes custom borrowing implementations for custom smart pointers sound.
2013-07-18auto merge of #7833 : blake2-ppc/rust/hashmap-consume, r=alexcrichtonbors-65/+21
Updated all users of HashMap, HashSet ::consume() to use .consume_iter(). Since .consume_iter() takes the map or set by value, it needs awkward extra code to in librusti's use of @mut HashMap, where the map value can not be directly moved out. Addresses issue #7719
2013-07-18auto merge of #7842 : thestinger/rust/closure, r=huonwbors-37/+24
2013-07-18hashmap: Remove .consume() has rename .consume_iter() to .consume()blake2-ppc-65/+21
Updated all users of HashMap, HashSet old .consume() to use .consume() with a for loop. Since .consume() takes the map or set by value, it needs awkward extra code to in librusti's use of @mut HashMap, where the map value can not be directly moved out.
2013-07-18repr: add a test case for @mut inside another typeDaniel Micay-2/+2
2013-07-18fix repr of @mut vectorsDaniel Micay-6/+5
2013-07-18Fix warnings in libstd and librusti testsblake2-ppc-9/+8
2013-07-17fix repr of unique vectors with stage0 libstdDaniel Micay-0/+9
Closes #7860
2013-07-17libsyntax: Remove some multi-gigabyte clones that were preventing ↵Patrick Walton-0/+7
bootstrapping on Windows.
2013-07-17test: Fix tests.Patrick Walton-4/+4
2013-07-17librustc: Remove the `Copy` bound from the language.Patrick Walton-7/+1
2013-07-17test: Fix tests.Patrick Walton-24/+21
2013-07-17librustc: Remove all uses of the `Copy` bound.Patrick Walton-43/+34
2013-07-17librustc: Remove all uses of "copy".Patrick Walton-206/+273
2013-07-17librustc: Add a lint mode for unnecessary `copy` and remove a bunch of them.Patrick Walton-5/+5
2013-07-17rm unnecessary stage0 `zero_memory` fnDaniel Micay-28/+6
2013-07-17std::rt: Rename RUST_TEST_THREADS to RUST_RT_TEST_THREADSBrian Anderson-1/+1
2013-07-17rm unused visit_str method from TyVisitorDaniel Micay-1/+2
2013-07-17auto merge of #7841 : alexcrichton/rust/tls++, r=huonwbors-16/+145
Simulates borrow checks for '@mut' boxes, or at least it's the same idea. This allows you to store owned values, but mutate them while they're owned by TLS. This should remove the necessity for a `pop`/`set` pattern to mutate data structures in TLS.
2013-07-16auto merge of #7831 : ozten/rust/issues-7764-swap_unwarp-take-unwrap, r=pcwaltonbors-25/+25
Fixes Issue #7764 Running `make check` I do get a failure: test rt::io::extensions::test::push_bytes ... ok rustest rt::comm::test::oneshot_single_thread_send_port_close ... t: task failed at 'Unhandled condition: read_error: {kind: OtherIoError, desc: "Placeholder error. You shouldn\'t be seeing this", detail: None}', /Users/shout/Projects/rust/src/libstd/condition.rs:50 /bin/sh: line 1: 35056 Abort trap: 6 x86_64-apple-darwin/stage2/test/stdtest-x86_64-apple-darwin --logfile tmp/check-stage2-T-x86_64-apple-darwin-H-x86_64-apple-darwin-std.log make: *** [tmp/check-stage2-T-x86_64-apple-darwin-H-x86_64-apple-darwin-std.ok] Error 134
2013-07-16Add a `get_mut` method for TLSAlex Crichton-16/+145
Simulates borrow checks for '@mut' boxes, or at least it's the same idea.
2013-07-16auto merge of #7684 : ↵bors-43/+160
pnkfelix/rust/fsk-invert-range-rev-halfclosedness-issue5270-2ndpr, r=cmr Changes int/uint range_rev to iterate over range `(hi,lo]` instead of `[hi,lo)`. Fix #5270. Also: * Adds unit tests for int/uint range functions * Updates the uses of `range_rev` to account for the new semantics. (Note that pretty much all of the updates there were strict improvements to the code in question; yay!) * Exposes new function, `range_step_inclusive`, which does the range `[hi,lo]`, (at least when `hi-lo` is a multiple of the `step` parameter). * Special-cases when `|step| == 1` removing unnecessary bounds-check. (I did not check whether LLVM was already performing this optimization; I figure it would be a net win to not leave that analysis to the compiler. If reviewer objects, I can easily remove that from the refactored code.) (This pull request is a rebased version of PR #7524, which went stale due to recent unrelated changes to num libraries.)
2013-07-16Rename Option swap_unwrap to take_unwrap. Fixes Issue#7764Austin King-25/+25
2013-07-15auto merge of #7816 : thestinger/rust/header, r=huonwbors-17/+129
Note that the headers are still on `~[T]` when `T` is managed. This is continued from #7605, which removed all the code relying on the headers and removed them from `~T` for non-managed `T`.
2013-07-15remove headers from unique vectorsDaniel Micay-17/+129
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.