summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
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>`
2013-08-15Update either::partitionblake2-ppc-2/+3
Remove the only use of either::partition since it was better accomplished with vector methods. Update either::partition so that it sizes the vectors correctly before it starts.
2013-08-15std: Change either::{lefts, rights} to return an iteratorblake2-ppc-25/+28
2013-08-14std: Change ProcessOptions struct to have an option of a ~ vectorTim Chevalier-10/+10
This is a workaround for #8498
2013-08-14Rewrite Saturating in terms of CheckedAdd/CheckedSubKevin Ballard-38/+25
2013-08-14auto merge of #8452 : Kimundi/rust/stuff02, r=bstriebors-47/+88
- Methodyfied the string ascii extionsion functions - They got added recently, I wrapped them in a trait. - Added `into_owned()` method for vectors - similar to `Str`'s `into_owned()` function, allows to convert to a owned vector without making a copy if the source is a owned vector. - Added `or_some` method to option - similar to `unwrap_or_default`, but keeps the values wrapped in an `Option`. Useful for `Option` chains, eg Iterator impls. - Added `DoubleEndedIterator` impl to `Option` - Just for compatibility with generic Iterator functions. - Renamed nil.rs to unit.rs - the type got renamed ages ago, it's time the source file is as well.
2013-08-15std: Move the iterator param on FromIterator and Extendable to the method.Huon Wilson-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-14Methodyfied the string ascii extionsion functionsMarvin Löbel-47/+88
Added into_owned() method for vectors Added DoubleEnded Iterator impl to Option Renamed nil.rs to unit.rs
2013-08-14Add sysconf names for AndroidSeo Sanghyeon-224/+214
2013-08-14auto merge of #8439 : huonw/rust/hashset-clone, r=cmrbors-0/+26
Closes #5581.
2013-08-13auto merge of #8446 : alexcrichton/rust/ifmt++, r=graydonbors-117/+622
This includes a number of improvements to `ifmt!` * Implements formatting arguments -- `{:0.5x}` works now * Formatting now works on all integer widths, not just `int` and `uint` * Added a large doc block to `std::fmt` which should help explain what `ifmt!` is all about * Added floating point formatters, although they have the same pitfalls from before (they're just proof-of-concept now) Closed a couple of issues along the way, yay! Once this gets into a snapshot, I'll start looking into removing all of `fmt`
2013-08-13Add `f` formats to `ifmt!`Alex Crichton-1/+33
Currently the work just the same as the old `extfmt` versions
2013-08-13auto merge of #8475 : kmcallister/rust/stack_segment, r=brson,brsonbors-2/+2
Servo needs to tell SpiderMonkey about the stack bounds. r? @brson
2013-08-13Make rt::stack publicKeegan McAllister-1/+1
Fixes #8478.
2013-08-13auto merge of #8423 : alexcrichton/rust/less-priv-again, r=bstriebors-30/+30
Closes #5495
2013-08-13Add RngUtils::sample() method for reservoir sampling from iteratorsRobert Knight-0/+56
2013-08-13auto merge of #8411 : bblum/rust/assorted-fixes, r=brsonbors-479/+469
Each commit is pretty much what it says on the tin. r anybody.
2013-08-12auto merge of #8487 : brson/rust/local-opts, r=brsonbors-16/+24
I did this once but acciddentally undid it in a later patch.
2013-08-12Forbid pub/priv where it has no effectAlex Crichton-30/+30
Closes #5495
2013-08-12Explain what ifmt! is all aboutAlex Crichton-0/+301
2013-08-12Correct the padding on integer types for formattingAlex Crichton-43/+63
2013-08-12Define integer formats for all widthsAlex Crichton-37/+56
Closes #1653
2013-08-12Implement formatting arguments for strings and integersAlex Crichton-63/+196
Closes #1651
2013-08-12std: Re-optimize tls access on local allocation pathBrian Anderson-16/+24
I did this once but acciddentally undid it in a later patch.
2013-08-12auto merge of #8476 : thestinger/rust/snapshot, r=brsonbors-599/+16
2013-08-12std::at_vec: add benchmarksCorey Richardson-0/+81
2013-08-12auto merge of #8419 : cmr/rust/fix-rtdebug, r=brsonbors-12/+4
It now actually does logging, and is compiled out when `--cfg rtdebug` is not given to the libstd build, which it isn't by default. This makes the rt benchmarks 18-50% faster.
2013-08-12fix build with the new snapshot compilerDaniel Micay-599/+16
2013-08-12rt::task: Make current_stack_segment publicKeegan McAllister-1/+1
Servo needs to tell SpiderMonkey about the stack bounds.
2013-08-12Clean up transitionary glue in task/spawn.rs. Don't hold kill-little-lock ↵Ben Blum-138/+69
for O(n) time, cf #3100, and optimize out several unneeded clone()s.
2013-08-12auto merge of #8400 : blake2-ppc/rust/seq-ord, r=cmrbors-70/+247
Use Eq + Ord for lexicographical ordering of sequences. For each of <, <=, >= or > as R, use:: [x, ..xs] R [y, ..ys] = if x != y { x R y } else { xs R ys } Previous code using `a < b` and then `!(b < a)` for short-circuiting fails on cases such as [1.0, 2.0] < [0.0/0.0, 3.0], where the first element was effectively considered equal. Containers like &[T] did also implement only one comparison operator `<`, and derived the comparison results from this. This isn't correct either for Ord. Implement functions in `std::iterator::order::{lt,le,gt,ge,equal,cmp}` that all iterable containers can use for lexical order. We also visit tuple ordering, having the same problem and same solution (but differing implementation).