summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2014-04-22native: Unlink unix socket paths on dropAlex Crichton-0/+16
This prevents unix sockets from remaining on the system all over the place, and more closely mirrors the behavior of libuv and windows pipes.
2014-04-22auto merge of #13651 : ryantm/rust/master, r=brsonbors-3/+2
2014-04-22Implement Show for &mut [T]Thomas Backman-0/+12
2014-04-21str: Inline `only_ascii` in string iterators.Patrick Walton-0/+4
Was killing performance of selector matching in Servo.
2014-04-21Fix misspellings in comments.Joseph Crail-15/+15
2014-04-20fix copyright message based on `make check`Ryan Mulligan-3/+3
2014-04-20remove meaningless sentence and update copyright.Ryan Mulligan-5/+4
2014-04-20auto merge of #13410 : alexcrichton/rust/issue-12278, r=pcwaltonbors-2/+8
This commit removes the compiler support for floating point modulus operations, as well as from the language. An implementation for this operator is now required to be provided by libraries. Floating point modulus is rarely used, doesn't exist in C, and is always lowered to an fmod library call by LLVM, and LLVM is considering removing support entirely. Closes #12278
2014-04-20auto merge of #13643 : aochagavia/rust/pr-2, r=alexcrichtonbors-4/+6
Fixed a typo in the documentation of std::mem, and refactored a function to use match instead of if. Also added a FIXME to the benchmarks at the end of the file stating that they should be moved to another place, because they have nothing to do with `mem` (see https://github.com/mozilla/rust/issues/13642)
2014-04-20Minor changes in std::memaochagavia-4/+6
Fixed a typo in the documentation of std::mem, and refactored a function to use match instead of if. Also added a FIXME to the benchmarks at the end of the file stating that they should be moved to another place, because they have nothing to do with `mem` (see https://github.com/mozilla/rust/issues/13642)
2014-04-20Fix spelling mistakes in documentation and code.Joseph Crail-2/+2
2014-04-19auto merge of #13613 : alexcrichton/rust/fix-freebsd-compile, r=brsonbors-3/+2
Ah, the wonders of not being gated on FreeBSD...
2014-04-19auto merge of #13610 : jsanders/rust/sender-try-send-docs, r=alexcrichtonbors-5/+5
I was getting a bit confused by these and (I think) managed to track it down to fallout from #13448 and #13465.
2014-04-19Rewrite paragraph describing difference between try_send and send_optJames Sanders-4/+4
2014-04-19auto merge of #13615 : alexcrichton/rust/improve-demangling, r=brsonbors-3/+13
Previously, symbols with rust escape sequences (denoted with dollar signs) weren't demangled if the escape sequence showed up in the middle. This alters the printing loop to look through the entire string for dollar characters.
2014-04-19auto merge of #13614 : cgaebel/rust/master, r=brsonbors-0/+6
We previously allocated 3x for every HashMap creation and resize. This patch reduces it to 1x.
2014-04-19std: Add an experimental connect_timeout functionAlex Crichton-2/+20
This adds a `TcpStream::connect_timeout` function in order to assist opening connections with a timeout (cc #13523). There isn't really much design space for this specific operation (unlike timing out normal blocking reads/writes), so I am fairly confident that this is the correct interface for this function. The function is marked #[experimental] because it takes a u64 timeout argument, and the u64 type is likely to change in the future.
2014-04-18auto merge of #13606 : alexcrichton/rust/better-thread-errors, r=brsonbors-4/+17
On windows, correctly check for errors when spawning threads, and on both windows and unix handle the error more gracefully rather than printing an opaque assertion failure. Closes #13589
2014-04-19Reorder Float methods in trait definition and make consistent in implsBrendan Zabarauskas-293/+268
2014-04-19Fix formatting in float implementationsBrendan Zabarauskas-72/+198
2014-04-19Have floating point functions take their parameters by value.Brendan Zabarauskas-154/+154
Make all of the methods in `std::num::Float` take `self` and their other parameters by value. Some of the `Float` methods took their parameters by value, and others took them by reference. This standardises them to one convention. The `Float` trait is intended for the built in IEEE 754 numbers only so we don't have to worry about the trait serving types of larger sizes. [breaking-change]
2014-04-19Merge the Round trait into the Float traitBrendan Zabarauskas-78/+71
Move the rounding functions into the `std::num::Float` trait and then remove `std::num::Round`. This continues the flattening of the numeric traits tracked in #10387. The aim is to make `std::num` very simple and tied to the built in types, leaving the definition of more complex numeric towers to third-party libraries. [breaking-change]
2014-04-18std: Fix demangling with middle special charsAlex Crichton-3/+13
Previously, symbols with rust escape sequences (denoted with dollar signs) weren't demangled if the escape sequence showed up in the middle. This alters the printing loop to look through the entire string for dollar characters.
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-505/+543
2014-04-18Reduce HashMap allocations.Clark Gaebel-0/+6
2014-04-18std: Fix compiling on FreeBSDAlex Crichton-3/+2
Ah, the wonders of not being gated on FreeBSD...
2014-04-18Fix a couple places in docs where try_send wasn't changed to send_optJames Sanders-2/+2
2014-04-18Update the rest of the compiler with ~[T] changesAlex Crichton-25/+20
2014-04-18std: Fail more gracefully on thread spawn errorsAlex Crichton-4/+17
On windows, correctly check for errors when spawning threads, and on both windows and unix handle the error more gracefully rather than printing an opaque assertion failure. Closes #13589
2014-04-18std: Make ~[T] no longer a growable vectorAlex Crichton-999/+342
This removes all resizability support for ~[T] vectors in preparation of DST. The only growable vector remaining is Vec<T>. In summary, the following methods from ~[T] and various functions were removed. Each method/function has an equivalent on the Vec type in std::vec unless otherwise stated. * slice::OwnedCloneableVector * slice::OwnedEqVector * slice::append * slice::append_one * slice::build (no replacement) * slice::bytes::push_bytes * slice::from_elem * slice::from_fn * slice::with_capacity * ~[T].capacity() * ~[T].clear() * ~[T].dedup() * ~[T].extend() * ~[T].grow() * ~[T].grow_fn() * ~[T].grow_set() * ~[T].insert() * ~[T].pop() * ~[T].push() * ~[T].push_all() * ~[T].push_all_move() * ~[T].remove() * ~[T].reserve() * ~[T].reserve_additional() * ~[T].reserve_exect() * ~[T].retain() * ~[T].set_len() * ~[T].shift() * ~[T].shrink_to_fit() * ~[T].swap_remove() * ~[T].truncate() * ~[T].unshift() * ~str.clear() * ~str.set_len() * ~str.truncate() Note that no other API changes were made. Existing apis that took or returned ~[T] continue to do so. [breaking-change]
2014-04-17auto merge of #13580 : DiamondLovesYou/rust/std-result-hash, r=alexcrichtonbors-1/+1
Title says it all.
2014-04-17auto merge of #13558 : alexcrichton/rust/snapshots, r=brsonbors-25/+1
This is the first snapshot build by mingw-w64 with the win32 threading model I believe (Closes #13501). Curiously, this successfully built a snapshot on freebsd when the auto builder is continuously segfaulting. Who knew!
2014-04-17Add #[deriving(Hash)] to Result.Richard Diamond-1/+1
2014-04-16auto merge of #13499 : brson/rust/resultdocs, r=brsonbors-5/+325
This adds some fairly extensive documentation for `Result`. I'm using manual links to other rustdoc html pages a bit.
2014-04-16auto merge of #13465 : alexcrichton/rust/fix-comm-dox, r=brsonbors-23/+77
Some of this documentation got a little out of date. There was no mention of a `SyncSender`, and the entire "Outside the runtime" section isn't really true any more (or really all that relevant). This also updates a few other doc blocks and adds some examples.
2014-04-16doc: Address review feedbackBrian Anderson-17/+14
2014-04-16std: Improve docs for mod 'result'Brian Anderson-5/+328
2014-04-16Register new snapshotsAlex Crichton-25/+1
2014-04-16auto merge of #13539 : Aatch/rust/vector-copy-faster, r=thestingerbors-5/+38
LLVM wasn't recognising the loops as memcpy loops and was therefore failing to optimise them properly. While improving LLVM is the "proper" way to fix this, I think that these cases are important enough to warrant a little low-level optimisation. Fixes #13472 r? @thestinger --- Benchmark Results: ``` --- Before --- test clone_owned ... bench: 6126104 ns/iter (+/- 285962) = 170 MB/s test clone_owned_to_owned ... bench: 6125054 ns/iter (+/- 271197) = 170 MB/s test clone_str ... bench: 80586 ns/iter (+/- 11489) = 13011 MB/s test clone_vec ... bench: 3903220 ns/iter (+/- 658556) = 268 MB/s test test_memcpy ... bench: 69401 ns/iter (+/- 2168) = 15108 MB/s --- After --- test clone_owned ... bench: 70839 ns/iter (+/- 4931) = 14801 MB/s test clone_owned_to_owned ... bench: 70286 ns/iter (+/- 4836) = 14918 MB/s test clone_str ... bench: 78519 ns/iter (+/- 5511) = 13353 MB/s test clone_vec ... bench: 71415 ns/iter (+/- 1999) = 14682 MB/s test test_memcpy ... bench: 70980 ns/iter (+/- 2126) = 14772 MB/s ```
2014-04-16auto merge of #13522 : seanmonstar/rust/sip, r=alexcrichtonbors-42/+143
work started from @gereeter's PR: https://github.com/mozilla/rust/pull/13114 but adjusted bits ``` before test hash::sip::tests::bench_u64 ... bench: 34 ns/iter (+/- 0) test hash::sip::tests::bench_str_under_8_bytes ... bench: 37 ns/iter (+/- 1) test hash::sip::tests::bench_str_of_8_bytes ... bench: 43 ns/iter (+/- 1) test hash::sip::tests::bench_str_over_8_bytes ... bench: 50 ns/iter (+/- 1) test hash::sip::tests::bench_long_str ... bench: 613 ns/iter (+/- 14) test hash::sip::tests::bench_compound_1 ... bench: 114 ns/iter (+/- 11) after test hash::sip::tests::bench_u64 ... bench: 25 ns/iter (+/- 0) test hash::sip::tests::bench_str_under_8_bytes ... bench: 31 ns/iter (+/- 0) test hash::sip::tests::bench_str_of_8_bytes ... bench: 36 ns/iter (+/- 0) test hash::sip::tests::bench_str_over_8_bytes ... bench: 40 ns/iter (+/- 0) test hash::sip::tests::bench_long_str ... bench: 600 ns/iter (+/- 14) test hash::sip::tests::bench_compound_1 ... bench: 64 ns/iter (+/- 6) ``` Notably it seems smaller keys will hash faster. A long string doesn't see much gains, but compound cuts in half (once compound used a `int` and `u64`).
2014-04-15auto merge of #13532 : alexcrichton/rust/rollup, r=alexcrichtonbors-127/+159
2014-04-15std: Un-ignore some float tests on windowsAlex Crichton-2/+2
These were fixed in the upgrade from mingw32 to mingw64. Closes #8663
2014-04-15std: Remove pub use globsBrian Anderson-13/+25
2014-04-15Add a default impl for Set::is_supersetSteven Fackler-1/+3
I also deleted a bunch of documentation that was copy/pasted from the trait definition.
2014-04-15Use the unsigned integer types for bitwise intrinsics.Huon Wilson-85/+109
Exposing ctpop, ctlz, cttz and bswap as taking signed i8/i16/... is just exposing the internal LLVM names pointlessly (LLVM doesn't have "signed integers" or "unsigned integers", it just has sized integer types with (un)signed *operations*). These operations are semantically working with raw bytes, which the unsigned types model better.
2014-04-15std: Impl Deref/DerefMut for a borrowed taskAlex Crichton-26/+20
2014-04-16Make Vec::clone and slice::to_owned failure-safeJames Miller-17/+19
2014-04-15auto merge of #13498 : johnsoft/rust/fix-transmute-fn-names, r=alexcrichtonbors-7/+7
Regions were renamed to lifetimes a while back, so these functions should probably be renamed as well.
2014-04-16Improve the copying code for slices and VecJames Miller-5/+36
2014-04-15optimized SipHash implementationSean McArthur-42/+143
work started from @gereeter's PR: https://github.com/mozilla/rust/pull/13114 but adjusted bits