about summary refs log tree commit diff
path: root/src/libextra
AgeCommit message (Collapse)AuthorLines
2014-01-16Update test run summaryDerek Guenther-1/+1
2014-01-16auto merge of #11597 : sfackler/rust/err-enums, r=alexcrichtonbors-14/+47
An enum allows callers to deal with errors in a more reasonable way.
2014-01-15Stop returning error strings in From{Base64,Hex}Steven Fackler-14/+47
An enum allows callers to deal with errors in a more reasonable way.
2014-01-16Merge Bitwise and BitCount traits and remove from prelude, along with BoundedBrendan Zabarauskas-1/+3
One less trait in std::num, and three less exported in the prelude.
2014-01-15auto merge of #11112 : alexcrichton/rust/issue-11087, r=brsonbors-10/+13
This should allow callers to know whether the channel was empty or disconnected without having to block. Closes #11087
2014-01-15fixup! ebml::extra: Optimize reader::vuint_at()Carl-Anton Ingmarsson-1/+2
2014-01-15Allow more "error" values in try_recv()Alex Crichton-10/+13
This should allow callers to know whether the channel was empty or disconnected without having to block. Closes #11087
2014-01-15Add a configure to disable libstd version injectionAlex Crichton-1/+2
We'll use this when building snapshots so we can upgrade freely, but all compilers will inject a version by default.
2014-01-14extra: Ignore time tests on android correctlyBrian Anderson-1/+1
2014-01-13Add Clone to TreeSetYehuda Katz-0/+11
2014-01-12Bump version to 0.10-preBrian Anderson-1/+1
2014-01-13Clean up std::num::cmath and remove stale commentsBrendan Zabarauskas-1/+1
2014-01-12ebml::extra: Optimize reader::vuint_at()Carl-Anton Ingmarsson-22/+29
Use a lookup table, SHIFT_MASK_TABLE, that for every possible four bit prefix holds the number of times the value should be right shifted and what the right shifted value should be masked with. This way we can get rid of the branches which in my testing gives approximately a 2x speedup.
2014-01-12extra::ebml: Add unit test for vuint_at()Carl-Anton Ingmarsson-0/+48
2014-01-12extra::ebml: Make reader::Res publicCarl-Anton Ingmarsson-1/+1
Since reader::vuint_at() returns a result of type reader::Res it makes sense to make it public. Due to rust's current behavior of externally referenced private structures, https://github.com/mozilla/rust/issues/10573, you could still use the result and assign it to a variable if you let the compiler do the type assignment, but you could not explicitly annotate a variable to hold a reader::Res.
2014-01-11extra::workcache: Remove unused Loggerklutzy-31/+6
2014-01-11Remove re-exports of std::io::stdio::{print, println} in the prelude.Brendan Zabarauskas-13/+13
The `print!` and `println!` macros are now the preferred method of printing, and so there is no reason to export the `stdio` functions in the prelude. The functions have also been replaced by their macro counterparts in the tutorial and other documentation so that newcomers don't get confused about what they should be using.
2014-01-09rename Strong -> Rc, replacing `rc` with `weak`Daniel Micay-1/+1
2014-01-09stop treating `Rc` cycles as unsafeDaniel Micay-2/+2
2014-01-09Remove eof() from io::ReaderAlex Crichton-1/+1
2014-01-09auto merge of #11412 : bjz/rust/num-cleanups, r=alexcrichtonbors-10/+8
The methods contained in `std::num::{Algebraic, Trigonometric, Exponential, Hyperbolic}` have now been moved into `std::num::Real`. This is part of an ongoing effort to simplify `std::num` (see issue #10387). `std::num::RealExt` has also been removed from the prelude because it is not a commonly used trait. r? @alexcrichton
2014-01-09auto merge of #11402 : bjz/rust/remove-approx, r=alexcrichtonbors-1/+9
This trait seems to stray too far from the mandate of a standard library as implementations may vary between use cases. Third party libraries should implement their own if they need something like it. This closes #5316. r? @alexcrichton, @pcwalton
2014-01-08Remove the io::Decorator traitAlex Crichton-28/+12
This is just an unnecessary trait that no one's ever going to parameterize over and it's more useful to just define the methods directly on the types themselves. The implementors of this type almost always don't want inner_mut_ref() but they're forced to define it as well.
2014-01-09Remove ApproxEq and assert_approx_eq!Brendan Zabarauskas-1/+9
This trait seems to stray too far from the mandate of a standard library as implementations may vary between use cases.
2014-01-09Merge some numeric traits with Real and don't re-export RealExtBrendan Zabarauskas-10/+8
The methods contained in `std::num::{Algebraic, Trigonometric, Exponential, Hyperbolic}` have now been moved into `std::num::Real`. This is part of an ongoing effort to simplify `std::num` (see issue #10387). `std::num::RealExt` has also been removed from the prelude because it is not a commonly used trait.
2014-01-08auto merge of #11370 : alexcrichton/rust/issue-10465, r=pwaltonbors-49/+39
Turned out to be a 2-line fix, but the compiler fallout was huge.
2014-01-08auto merge of #11405 : huonw/rust/moredocs, r=huonwbors-3/+3
Various documentation changes, change the 'borrowed pointer' terminology to 'reference', fix a problem with 'make dist' on windows.
2014-01-08auto merge of #11358 : pcwalton/rust/typed-arenas, r=alexcrichtonbors-33/+319
A typed arena is a type of arena that can only allocate objects of one type. It is 3x faster than the existing arena and 13x faster than malloc on Mac. r? @brson
2014-01-07extratest: Fix all leaked trait importsAlex Crichton-47/+39
2014-01-07Fix remaining cases of leaking importsAlex Crichton-2/+0
2014-01-07'borrowed pointer' -> 'reference'Brian Anderson-3/+3
2014-01-07libextra: Introduce typed arenas.Patrick Walton-33/+319
A typed arena is a type of arena that can only allocate objects of one type. It is 3x faster than the existing arena and 13x faster than malloc on Mac.
2014-01-08Renamed Option::map_default and mutate_default to map_or and mutate_or_setMarvin Löbel-12/+12
2014-01-07auto merge of #11263 : niftynif/rust/btree, r=catamorphismbors-115/+256
Apologies for junking up the feed with all of these separate pull requests. I'm still getting the hang of git and will hopefully be doing less of this nonsense soon. I opened up another PR and closed the one from earlier today because the first PR was coming from the wrong branch of my repo. Anyway, this contains a fleshed-out implementation of TotalEq/TotalOrd/Clone/ToStr for the whole B-tree structure and relevant tests, integrating suggestions and comments from several community members. r? @catamorphism
2014-01-07auto merge of #11342 : huonw/rust/trie-mut, r=alexcrichtonbors-30/+21
- Add `mut_iter`, `mut_lower_bound`, `mut_upper_bound` - Remove some internal iterators - Add benchmarks - Improve performance of `{mut_,}{lower,upper}_bound` - Minor clean-up of `extra::treemap` after I realised I wasn't exploiting macros to their full DRY potential.
2014-01-08extra::treemap: use the dummy-macro trick with items to make theHuon Wilson-16/+13
iterator macro properly hygiene. Requires less repetition of `mut` or not too.
2014-01-08std::trie: remove some obsolete internal iterators.Huon Wilson-14/+8
2014-01-07auto merge of #11329 : fhahn/rust/unused-cast-lint2, r=alexcrichtonbors-8/+8
Updates as mentioned in #11135
2014-01-06auto merge of #11296 : brson/rust/anti-cond, r=alexcrichtonbors-34/+48
In preparation for removing conditions.
2014-01-06Added in Clone/TotalEq/TotalOrd/ToStr traits to all parts of btree.Nif Ward-115/+256
Equals is now compact and uses vec's equals method. Cmp compares all elements on branches and leaves (Nodes).
2014-01-06Remove some unnecessary type castsFlorian Hahn-8/+8
Conflicts: src/librustc/middle/lint.rs
2014-01-06auto merge of #11333 : cmr/rust/triage2, r=alexcrichtonbors-1/+3
2014-01-05Remove a fixmeCorey Richardson-1/+3
I don't think it's relevant, a warning is more appropriate. Easier to just maintain the order. Closes #4681
2014-01-06extra::treemap: share code between the mutable and immutable iterators.Huon Wilson-271/+205
Yay for macros.
2014-01-06extra::treemap: remove mutate_values, replaced by .mut_iter().Huon Wilson-23/+0
2014-01-06extra::treemap: add mutable-value iterators.Huon Wilson-1/+278
2014-01-04Don't allow newtype structs to be dereferenced. #6246Brian Anderson-20/+46
2014-01-03auto merge of #11251 : pcwalton/rust/remove-at-mut, r=pcwaltonbors-79/+55
r? @nikomatsakis for the borrow checker changes. Write guards are now eliminated.
2014-01-03auto merge of #11280 : c-a/rust/inline_byteswap, r=brsonbors-0/+84
After writing some benchmarks for ebml::reader::vuint_at() I noticed that LLVM doesn't seem to inline the from_be32 function even though it only does a call to the bswap32 intrinsic in the x86_64 case. Marking the functions with #[inline(always)] fixes that and seems to me a reasonable thing to do. I got the following measurements in my vuint_at() benchmarks: - Before test ebml::bench::vuint_at_A_aligned ... bench: 1075 ns/iter (+/- 58) test ebml::bench::vuint_at_A_unaligned ... bench: 1073 ns/iter (+/- 5) test ebml::bench::vuint_at_D_aligned ... bench: 1150 ns/iter (+/- 5) test ebml::bench::vuint_at_D_unaligned ... bench: 1151 ns/iter (+/- 6) - Inline from_be32 test ebml::bench::vuint_at_A_aligned ... bench: 769 ns/iter (+/- 9) test ebml::bench::vuint_at_A_unaligned ... bench: 795 ns/iter (+/- 6) test ebml::bench::vuint_at_D_aligned ... bench: 758 ns/iter (+/- 8) test ebml::bench::vuint_at_D_unaligned ... bench: 759 ns/iter (+/- 8) - Using vuint_at_slow() test ebml::bench::vuint_at_A_aligned ... bench: 646 ns/iter (+/- 7) test ebml::bench::vuint_at_A_unaligned ... bench: 645 ns/iter (+/- 3) test ebml::bench::vuint_at_D_aligned ... bench: 907 ns/iter (+/- 4) test ebml::bench::vuint_at_D_unaligned ... bench: 1085 ns/iter (+/- 16) As expected inlining from_be32() gave a considerable speedup. I also tried how the "slow" version fared against the optimized version and noticed that it's actually a bit faster for small A class integers (using only two bytes) but slower for big D class integers (using four bytes)
2014-01-03extra: Remove condition from semverBrian Anderson-34/+48