summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2013-08-18Implement .size_hint() on new vec iteratorsKevin Ballard-1/+69
2013-08-18auto merge of #8565 : bblum/rust/select-bugfix, r=brsonbors-18/+23
@brson grilled me about how this bugfix worked the first time around, and it occurred to me that it didn't in the case where the task is unwinding. Now it will.
2013-08-18Delete std::rt::io::net::httpSteven Fackler-30/+0
It's an empty stub and as one of the comments notes, doesn't belong in libstd.
2013-08-18auto merge of #8560 : kballard/rust/reserve-yield, r=pcwaltonbors-32/+32
Rename task::yield() to task::deschedule(). Fixes #8494.
2013-08-18auto merge of #8545 : blake2-ppc/rust/iterbytes, r=alexcrichtonbors-61/+89
Address issue #5257, for example these values all had the same hash value: ("aaa", "bbb", "ccc") ("aaab", "bb", "ccc") ("aaabbb", "", "ccc") IterBytes for &[A] now includes the length, before calling iter_bytes on each element. IterBytes for &str is now terminated by a byte that does not appear in UTF-8. This way only one more byte is processed when hashing strings.
2013-08-18auto merge of #8558 : kballard/rust/xorshift-seed, r=cmrbors-6/+15
Fixes #8359.
2013-08-18std::hash: Add testcase for colliding hashes of tuplesblake2-ppc-0/+14
Add a testcase that verifies that (s, t) and (u, v) don't collide even if s + t == u + v (concatenation).
2013-08-18std::to_bytes: Implement IterBytes on 1- to 8-tuplesblake2-ppc-20/+29
2013-08-18std::to_bytes: Delimit sequences &[A] and ~str when hashingblake2-ppc-42/+47
Address issue #5257, for example these values all had the same hash value: ("aaa", "bbb", "ccc") ("aaab", "bb", "ccc") ("aaabbb", "", "ccc") IterBytes for &[A] now includes the length, before calling iter_bytes on each element. IterBytes for &str is now terminated by a byte that does not appear in UTF-8. This way only one more byte is processed when hashing strings.
2013-08-18auto merge of #8555 : chris-morgan/rust/time-clone, r=huonwbors-1/+15
I need `Clone` for `Tm` for my latest work on [rust-http](https://github.com/chris-morgan/rust-http) (static typing for headers, and headers like `Date` are a time), so here it is. @huonw recommended deriving DeepClone while I was at it. I also had to implement `DeepClone` for `~str` to get a derived implementation of `DeepClone` for `Tm`; I did `@str` while I was at it, for consistency.
2013-08-18auto merge of #8551 : huonw/rust/speling, r=alexcrichtonbors-58/+59
(This doesn't add/remove `u`s or change `ize` to `ise`, or anything like that.)
2013-08-18More spelling corrections.Huon Wilson-7/+9
2013-08-17auto merge of #8433 : brson/rust/rm-more-oldrt-crud, r=brsonbors-5/+0
Just deleting more stuff.
2013-08-17Fix warnings in testsErick Tryzelaar-1/+1
2013-08-16A round of code cleaning for the primary scheduler code. Comments have been ↵toddaaro-275/+201
updated, a minor amount of support type restructing has happened, methods have been reordered, and some duplicate code has been purged.
2013-08-16Moved the logic for a pausible idle callback into a new type - ↵toddaaro-96/+103
PausibleIdleCallback and placed the appropriate signatures in rtio and implementation into uvio.
2013-08-16std::rt: Fix a race in UvRemoteCallback's dtor that misses callbacksBrian Anderson-7/+74
Full description in comments.
2013-08-16std::rt: Touch up idle logicBrian Anderson-16/+36
2013-08-16an attempt at a singleton pausible idle callback for each scheduler. suffers ↵toddaaro-19/+83
from nondeterministic deadlock and also pending scheduler messages on scheduler shutdown.
2013-08-16Delegate `{}` to Default instead of PolyAlex Crichton-1/+55
By using a separate trait this is overridable on a per-type basis and makes room for the possibility of even more arguments passed in for the future.
2013-08-16Implement `{:s}` for ~str and @str as wellAlex Crichton-3/+3
2013-08-16Reserve 'yield' keywordKevin Ballard-32/+32
Rename task::yield() to task::deschedule(). Fixes #8494.
2013-08-16Remove the annihilate lang itemBrian Anderson-5/+0
2013-08-16Give XorShiftRng::new() a random seedKevin Ballard-6/+15
Fixes #8359.
2013-08-16auto merge of #8534 : huonw/rust/tls-key-macro, r=alexcrichtonbors-2/+2
This allows the internal implementation details of the TLS keys to be changed without requiring the update of all the users. (Or, applying changes that *have* to be applied for the keys to work correctly, e.g. forcing LLVM to not merge these constants.)
2013-08-16auto merge of #8532 : kballard/rust/cstr-cleanup, r=ericktbors-66/+185
Implement interior null checking in `.to_c_str()`, among other changes.
2013-08-16Implement DeepClone for str types.Chris Morgan-1/+15
2013-08-16auto merge of #8526 : blake2-ppc/rust/either-result, r=catamorphismbors-82/+115
Retry of PR #8471 Replace the remaining functions marked for issue #8228 with similar functions that are iterator-based. Change `either::{lefts, rights}` to be iterator-filtering instead of returning a vector. Replace `map_vec`, `map_vec2`, `iter_vec2` in std::result with three functions: * `result::collect` gathers `Iterator<Result<V, U>>` to `Result<~[V], U>` * `result::fold` folds `Iterator<Result<T, E>>` to `Result<V, E>` * `result::fold_` folds `Iterator<Result<T, E>>` to `Result<(), E>`
2013-08-15auto merge of #8518 : catamorphism/rust/issue-8498-workaround, r=brsonbors-10/+10
r? @brson
2013-08-16doc: convert remaining uses of core:: to std::.Huon Wilson-21/+21
2013-08-16doc: correct spelling in documentation.Huon Wilson-30/+29
2013-08-16syntax: add a local_data_key macro that creates a key for access to the TLS.Huon Wilson-2/+2
This allows the internal implementation details of the TLS keys to be changed without requiring the update of all the users. (Or, applying changes that have to be applied for the keys to work correctly, e.g. forcing LLVM to not merge these constants.)
2013-08-15vec: rm redundant is_empty implementationsDaniel Micay-12/+0
2013-08-15iterator: cleanupDaniel Micay-4/+3
2013-08-15vec: rm obsolete zip and zip_sliceDaniel Micay-41/+1
These are obsoleted by the generic iterator `zip` adaptor. Unlike these, it does not clone the elements or allocate a new vector by default.
2013-08-15tuple: remove obsolete ExtendedTupleOpsDaniel Micay-53/+1
replaced by iterators (generic composable `map` and `zip` adaptors)
2013-08-15kinds: update documentationDaniel Micay-9/+3
2013-08-15ptr: inline the Clone implementationDaniel Micay-0/+1
2013-08-15auto merge of #8485 : alexcrichton/rust/add-tests, r=catamorphismbors-1/+1
Closes #3907 Closes #5493 Closes #4464 Closes #4759 Closes #5666 Closes #5884 Closes #5926 Closes #6318 Closes #6557 Closes #6898 Closes #6919 Closes #7222
2013-08-15Fix a typo in the ifmt doxAlex Crichton-1/+1
2013-08-15auto merge of #8515 : kballard/rust/saturating-checked, r=thestingerbors-38/+25
r? @thestinger
2013-08-15Fix select deschedule environment race for real this time, in light of task ↵Ben Blum-18/+23
killing.
2013-08-15auto merge of #8491 : robertknight/rust/7722-reservoir_sampling, r=graydonbors-0/+56
Fixes #7722 I had a couple of queries: - Should this return an array or an iterator? - Should this be a method on iterators or on the rng? I implemented it in RngUtils as it seemed to belong with shuffle().
2013-08-15auto merge of #8490 : huonw/rust/fromiterator-extendable, r=catamorphismbors-29/+29
If they are on the trait then it is extremely annoying to use them as generic parameters to a function, e.g. with the iterator param on the trait itself, if one was to pass an Extendable<int> to a function that filled it either from a Range or a Map<VecIterator>, one needs to write something like: fn foo<E: Extendable<int, Range<int>> + Extendable<int, Map<&'self int, int, VecIterator<int>>> (e: &mut E, ...) { ... } since using a generic, i.e. `foo<E: Extendable<int, I>, I: Iterator<int>>` means that `foo` takes 2 type parameters, and the caller has to specify them (which doesn't work anyway, as they'll mismatch with the iterators used in `foo` itself). This patch changes it to: fn foo<E: Extendable<int>>(e: &mut E, ...) { ... }
2013-08-15Make CString.iter() publicKevin Ballard-1/+1
2013-08-15Add ToCStr method .with_c_str()Kevin Ballard-53/+76
.with_c_str() is a replacement for the old .as_c_str(), to avoid unnecessary boilerplate. Replace all usages of .to_c_str().with_ref() with .with_c_str().
2013-08-15Check for interior nulls in .to_c_str()Kevin Ballard-12/+107
Previous dicussions about CString suggested that interior nulls should throw an error. This was never implemented. Add this now, using a condition (named null_byte) to allow for recovery. Add method .to_c_str_unchecked() that skips this check.
2013-08-14auto merge of #8481 : cmr/rust/bench/std/at_vec, r=graydonbors-0/+81
2013-08-14Clarify docs on CString.unwrap()Kevin Ballard-0/+1
CString.unwrap() drops ownership of the buffer on the floor. Put this in the docs.
2013-08-15std: Replace map_vec, map_vec2, iter_vec2 in std::resultblake2-ppc-55/+84
Replace these with three functions based on iterators: collect, fold, and fold_. The mapping part is replaced by iterator .map(), so the part that these functions do is to accumulate the final Result<,> value. * `result::collect` gathers `Iterator<Result<V, U>>` to `Result<~[V], U>` * `result::fold` folds `Iterator<Result<T, E>>` to `Result<V, E>` * `result::fold_` folds `Iterator<Result<T, E>>` to `Result<(), E>`