about summary refs log tree commit diff
path: root/src/libextra
AgeCommit message (Collapse)AuthorLines
2013-09-06move and duplicate macro defns in sha2 to make them hygienicJohn Clements-22/+40
... it would also have been possible to add all of their dependencies, but that would have increased the already-lengthy list of parameters. Also, if we had macros that could expand into macro defns, you could stage it. This seemed like the least painful choice.
2013-09-06Un-hork the bots by removing intermediate filesAlex Crichton-3/+13
The new glob tests created tmp/glob-tests as a directory, but the never removed it. The `make clean` target then attempted to `rm -f` on this, but it couldn't remove the directory. This both changes the clean target to `rm -rf` tmp files, and also alters the tests to delete the directory that all the files are added into.
2013-09-05Add fractional second support to str{p,f}timeSteven Fackler-3/+37
The ISO 8601 standard does not mandate any specific precision for fractional seconds, so this accepts input of any length, ignoring the part after the nanoseconds place. It may be more correct to round with the tenths of nanoseconds digit, but then we'd have to deal with carrying the round through the entire Tm struct (e.g. for a time like Dec 31 11:59.999999999999). %f is the format specifier that Python's datetime library uses for 0-padded microseconds so it seemed appropriate here. cc #2350
2013-09-05auto merge of #8914 : Dretch/rust/native-glob, r=alexcrichtonbors-0/+821
This is #8201 with a bunch of amendments to address the comments (and re-based).
2013-09-05Convert between BigInts and BigUintsDavid Creswick-0/+41
2013-09-05test the correct function (oops)David Creswick-2/+2
2013-09-05Generate random BigUints and BigIntsDavid Creswick-0/+53
2013-09-05auto merge of #9004 : brson/rust/issue-8660, r=thestingerbors-10/+1
The new scheduler makes better use of threads than the old.
2013-09-05extra: Don't overcommit test tasks. Closes #8660Brian Anderson-10/+1
The new scheduler makes better use of threads than the old.
2013-09-05Replace os::glob with extra::glob, which is written in rust,Gareth Smith-0/+821
fixing issue #6100.
2013-09-05Rename str::from_bytes to str::from_utf8, closes #8985Florian Hahn-19/+19
2013-09-04forbid cast as boolDaniel Micay-1/+1
This is currently unsound since `bool` is represented as `i8`. It will become sound when `bool` is stored as `i8` but always used as `i1`. However, the current behaviour will always be identical to `x & 1 != 0`, so there's no need for it. It's also surprising, since `x != 0` is the expected behaviour. Closes #7311
2013-09-04auto merge of #8966 : FlaPer87/rust/issue/7473, r=bblumbors-56/+105
Current access methods are nestable and unsafe. This patch renames current methods implementation - prepends unsafe_ - and implements 2 new methods that are both safe and un-nestable. Fixes #7473
2013-09-04stop treating char as an integer typeDaniel Micay-16/+19
Closes #7609
2013-09-04Use MuextArc and RWArc in docstringsFlaper Fesp-5/+5
2013-09-04Fixed docs and stylesFlaper Fesp-122/+30
2013-09-04Add a safe implementation of MutexArc::access* methodsFlaper Fesp-21/+162
Current access methods are nestable and unsafe. This patch renames current methods implementation - prepends unsafe_ - and implements 2 new methods that are both safe and un-nestable. Fixes #7473
2013-09-04Rename MutexArc access methods to unsafe_accessFlaper Fesp-9/+9
2013-09-03auto merge of #8884 : blake2-ppc/rust/exact-size-hint, r=huonwbors-1/+10
The message of the first commit explains (edited for changed trait name): The trait `ExactSize` is introduced to solve a few small niggles: * We can't reverse (`.invert()`) an enumeration iterator * for a vector, we have `v.iter().position(f)` but `v.rposition(f)`. * We can't reverse `Zip` even if both iterators are from vectors `ExactSize` is an empty trait that is intended to indicate that an iterator, for example `VecIterator`, knows its exact finite size and reports it correctly using `.size_hint()`. Only adaptors that preserve this at all times, can expose this trait further. (Where here we say finite for fitting in uint). --- It may seem complicated just to solve these small "niggles", (It's really the reversible enumerate case that's the most interesting) but only a few core iterators need to implement this trait. While we gain more capabilities generically for some iterators, it becomes a tad more complicated to figure out if a type has the right trait impls for it.
2013-09-01std/extra: Add ExactSize for Bitv, DList, RingBuf, Option iteratorsblake2-ppc-0/+9
2013-08-31auto merge of #8905 : sstewartgallus/rust/cleanup_tests, r=bblumbors-154/+153
In this commit I: - removed unneeded heap allocations - added extra whitespace to crowded expressions - and removed unneeded syntax Also, CC @bblum although this change is fairly unobjectionable.
2013-08-31Cleanup concurrency testsSteven Stewart-Gallus-154/+153
In this commit I: - removed unneeded heap allocations - added extra whitespace to crowded expressions - and removed unneeded syntax
2013-08-30auto merge of #8862 : dcrewi/rust/drop-redundant-ord-impls, r=thestingerbors-17/+2
If this were to break something, I would expect existing tests to catch it, and a `make check` run passes locally.
2013-08-30std: Implement .rposition() on double-ended iterators with known sizeblake2-ppc-1/+1
This is a generalization of the vector .rposition() method, to all double-ended iterators that have the ExactSizeHint trait. This resolves the slight asymmetry around `position` and `rposition` * position from front is `vec.iter().position()` * position from the back was, `vec.rposition()` is now `vec.iter().rposition()` Additionally, other indexed sequences (only `extra::ringbuf` I think), will have the same method available once it implements ExactSizeHint.
2013-08-30auto merge of #8858 : blake2-ppc/rust/small-bugs, r=alexcrichtonbors-1/+5
Fix a bug in `s.slice_chars(a, b)` that did not accept `a == s.len()`. Fix a bug in `!=` defined for DList. Also simplify NormalizationIterator to use the CharIterator directly instead of mimicing the iteration itself.
2013-08-29partial revert of 31fa865David Creswick-1/+1
Ratio is generic and so might contain a non-total orderable type. It should not use the default Ord implementation.
2013-08-29drop some redundant Ord method implementationsDavid Creswick-18/+3
2013-08-29extra::dlist: Fix bug in Eq::neblake2-ppc-1/+5
2013-08-29extra: error message should reflact that RUST_TEST_TASKS should be strictly ↵Huon Wilson-1/+1
positive (zero is illegal).
2013-08-29Make the unit-test framework check RUST_TEST_TASKS over RUST_THREADS.Huon Wilson-4/+15
Fixes #7335.
2013-08-27librustc: Fix merge falloutPatrick Walton-7/+8
2013-08-27librustc: Fix problem with cross-crate reexported static methods.Patrick Walton-1/+1
2013-08-27librustc: Fix merge fallout.Patrick Walton-1/+2
2013-08-27librustc: Ensure that type parameters are in the right positions in paths.Patrick Walton-45/+89
This removes the stacking of type parameters that occurs when invoking trait methods, and fixes all places in the standard library that were relying on it. It is somewhat awkward in places; I think we'll probably want something like the `Foo::<for T>::new()` syntax.
2013-08-27librustc: Remove `&const` and `*const` from the language.Patrick Walton-2/+2
They are still present as part of the borrow check.
2013-08-27auto merge of #8790 : huonw/rust/unsafearc, r=thestingerbors-10/+10
`UnsafeAtomicRcBox` &rarr; `UnsafeArc` (#7674), and `AtomicRcBoxData` &rarr; `ArcData` to reflect this. Also, the inner pointer of `UnsafeArc` is now `*mut ArcData`, which avoids some transmutes to `~`: i.e. less chance of mistakes.
2013-08-27Rename UnsafeAtomicRcBox to UnsafeArc. Fixes #7674.Huon Wilson-10/+10
2013-08-27Make rekillable consistent with unkillableFlaper Fesp-29/+19
As for now, rekillable is an unsafe function, instead, it should behave just like unkillable by encapsulating unsafe code within an unsafe block. This patch does that and removes unsafe blocks that were encapsulating rekillable calls throughout rust's libs. Fixes #8232
2013-08-26bigint: fix wrong benchmark fn namegifnksm-1/+1
2013-08-26bigint: Add benchmarksgifnksm-0/+44
2013-08-25bigint: un-ignore test_shrgifnksm-73/+68
2013-08-25bigint: inlining small functionsgifnksm-97/+92
2013-08-25bigint: remove unnecessary method implementsgifnksm-42/+0
2013-08-25bigint: cfg(target_arch = ...) => cfg(target_word_size = ...)gifnksm-25/+11
2013-08-25auto merge of #8710 : pnkfelix/rust/fsk-issue5516-codepoint-fix, r=alexcrichtonbors-5/+32
...bytes. (removing previous note about eff-eye-ex'ing #5516 since it actually does not do so, it just gets us half-way.)
2013-08-25char_len is more succinct than count_chars.Felix S. Klock II-2/+1
2013-08-24auto merge of #8679 : singingboyo/rust/json-to-impl, r=alexcrichtonbors-65/+61
to_str, to_pretty_str, to_writer, and to_pretty_writer were at the top level of extra::json, this moves them into an impl for Json to match with what's been done for the rest of libextra and libstd. (or at least for vec and str) Also meant changing some tests. Closes #8676.
2013-08-24Added note that there is still more to do on 5516.Felix S. Klock II-3/+30
Also added regression test for the byte vs codepoint issues that the previous commit fixes.
2013-08-24auto merge of #8722 : graydon/rust/2013-08-23-test-shard, r=msullivanbors-2/+36
This makes it relatively easy for us to split testsuite load between machines in buildbot. I've added buildbot-side support for setting up builders with -a.b suffixes (eg. linux-64-opt-vg-0.5, linux-64-opt-vg-1.5, linux-64-opt-vg-2.5, linux-64-opt-vg-3.5, linux-64-opt-vg-4.5 causes the valgrind-supervised testsuite to split 5 ways across hosts).
2013-08-23auto merge of #8716 : andrew-d/rust/andrew-fix-warnings, r=alexcrichtonbors-1/+1
Small, but whatever :8ball: