about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2013-05-18Use pattern-matching instead of conditionals where appropriate to improve ↵Brendan Zabarauskas-113/+81
code clarity
2013-05-18Use cond! macro where appropriateBrendan Zabarauskas-6/+78
2013-05-17auto merge of #6560 : gifnksm/rust/iterator-utils, r=thestingerbors-0/+262
This pull request adds following methods and traits. ```rust pub trait IteratorUtil { (snip) fn filter_map<'r, B>(self, f: &'r fn(A) -> Option<B>) -> FilterMapIterator<'r, A, B, Self>; (snip) fn to_vec(self) -> ~[A]; fn nth(&mut self, n: uint) -> A; fn first(&mut self) -> A; fn last(&mut self) -> A; fn fold<B>(&mut self, start: B, f: &fn(B, A) -> B) -> B; fn count(&mut self) -> uint; fn all(&mut self, f: &fn(&A) -> bool) -> bool; fn any(&mut self, f: &fn(&A) -> bool) -> bool; } pub trait AdditiveIterator<A> { fn sum(&mut self) -> A; } pub trait MultiplicativeIterator<A> { fn product(&mut self) -> A; } pub trait OrdIterator<A> { fn max(&mut self) -> Option<A>; fn min(&mut self) -> Option<A>; } ```
2013-05-17WhitespaceBrian Anderson-2/+2
2013-05-17core: Wire up `stream` to newschedBrian Anderson-242/+357
2013-05-17core: Wire up oneshot pipes to newschedBrian Anderson-124/+248
2013-05-17core::rt: implement `oneshot` and `stream`.Brian Anderson-1/+645
2013-05-17Merge remote-tracking branch 'brson/io' into incomingBrian Anderson-1132/+2929
2013-05-18Some cosmetic changes to num.rsMarvin Löbel-5/+4
2013-05-18libcore: Add `IteratorUtil::all`, `any` methodgifnksm-0/+31
2013-05-18libcore: Add `AdditiveIterator`, `MultiplicativeIterator`, `OrdIterator`gifnksm-0/+79
2013-05-18libcore: Add `IteratorUtil::fold`, `count`gifnksm-0/+27
2013-05-17libcore: Add `IteratoUtil::nth`, `first`, `last` methodgifnksm-0/+81
2013-05-17libcore: Add `IteratorUtil::filter_map` methodgifnksm-0/+35
2013-05-17libcore: Add `IteratorUtil::to_vec()` methodgifnksm-0/+9
2013-05-17auto merge of #6442 : sstewartgallus/rust/incoming, r=pcwaltonbors-3/+12
Added unit test to prevent similar mistakes from happening again. The previous method was wrong because it dereferenced a pointer to a void type to match on the result. No self pointer was needed, and the correct method signature took the self value by value. I feel silly that I made this mistake in https://github.com/mozilla/rust/pull/6348
2013-05-17auto merge of #6534 : brson/rust/intrinsic-docs, r=bstriebors-8/+68
2013-05-16auto merge of #6549 : bjz/rust/numeric-traits, r=thestingerbors-0/+21
As discussed on issue #4819. This is a naive implementation, trusting LLVM to do the relevant optimizations. In the future this could be implemented more efficiently, but it's a start.
2013-05-16auto merge of #6093 : alexcrichton/rust/issue-2647, r=thestingerbors-1/+0
Closes #2647 This way it's much easier to add lints throughout compilation correctly, and functions on impls can alter the way lints are emitted. This involved pretty much rewriting how lints are emitted. Beforehand, only items could alter the lint settings, so whenever a lint was added it had to be associated with whatever item id it was coming from. I removed this (possibly questionably) in favor of just specifying a span and a message when adding a lint. When lint checking comes around, it looks at all the lints and sees which node with attributes best encloses it and uses that level of linting. This means that all consumer code doesn't have to deal with what item things came from (especially because functions on impls aren't items). More details of this can be found in the code (and comments). As a bonus, I managed to greatly simplify emission of lints in resolve.rs about unused imports. Now instead of it manually tracking what the lint level is, it's all moved over into the lint module (as is to be expected).
2013-05-17Re-implement lint with less emphasis on item idsAlex Crichton-1/+0
This way it's much easier to add lints throughout compilation correctly, and functions on impls can alter the way lints are emitted.
2013-05-16auto merge of #6546 : cmr/rust/warning, r=thestingerbors-4/+2
2013-05-16auto merge of #6523 : cmr/rust/faster_each_permutation, r=luqmanabors-20/+127
Closes #5127
2013-05-16Update to new for-loop protocolCorey Richardson-4/+4
2013-05-17Implement sin_cos method for float, f64 and f32Brendan Zabarauskas-0/+21
2013-05-16Remove each_permutation_refCorey Richardson-60/+0
2013-05-16fix warningsCorey Richardson-4/+2
2013-05-16iter: add fold, sum and productDaniel Micay-0/+106
2013-05-16Update to modern rustCorey Richardson-29/+21
2013-05-16Ensure reverse_part does not access outside given vectorTommy M. McGuire-5/+5
2013-05-16Add reverse_part, replace each_permutation, add testsTommy M. McGuire-18/+193
2013-05-16core: Document some intrinsicsBrian Anderson-8/+68
2013-05-16auto merge of #6509 : thestinger/rust/clone, r=nikomatsakisbors-0/+14
somewhat annoying to actually call thanks to auto-deref, but it does let `deriving(Clone)` work
2013-05-15auto merge of #6488 : sammykim/rust/issue-6430, r=sanxiynbors-9/+15
Fix issue #6430.
2013-05-16Change unsafe functions to safe functionsSangeun Kim-9/+15
2013-05-15auto merge of #6505 : cmr/rust/unsetenv, r=catamorphismbors-1/+36
2013-05-15auto merge of #6527 : thestinger/rust/deep_clone, r=pcwaltonbors-11/+36
2013-05-15auto merge of #6503 : sonwow/rust/at_vec-renamed, r=graydonbors-14/+14
`str::from_slice` and `vec::from_slice` are changed to `str::to_owned` and `vec::to_owned`. (#6389) Replace `at_vec::from_owned` and `at_vec::from_slice` with `at_vec::to_managed_consume` and `at_vec::to_managed`.
2013-05-15add DeepClone impl for @T and @mut T with T: ConstDaniel Micay-11/+36
2013-05-15auto merge of #6499 : dotdash/rust/static_keywords, r=thestingerbors-0/+4
2013-05-15core::rt: Unignore a fixed TCP testBrian Anderson-1/+1
2013-05-15add a Clone impl for borrowed pointersDaniel Micay-0/+14
2013-05-15auto merge of #6498 : thestinger/rust/deep_clone, r=thestingerbors-10/+66
This is mostly for `std::rc` and `std::arc` (but I haven't implemented it for ARC yet). Implementing it correctly for managed boxes is *very* non-trivial. It would probably require an unholy mix of reflection and TLS.
2013-05-15Merge remote-tracking branch 'brson/io' into incomingBrian Anderson-1132/+2929
2013-05-15core::rt: Fix TCP test on macBrian Anderson-3/+8
2013-05-15core::rt: Copy many of the old io extensions to the new ioBrian Anderson-6/+334
Some resolve problem is keeping the tests from working
2013-05-15core::rt: More work on Reader extensions and error handlingBrian Anderson-65/+127
2013-05-15core::rt: Make push_bytes raise read_error on EOFBrian Anderson-19/+45
2013-05-15core::rt: WarningsBrian Anderson-18/+12
2013-05-15core::rt: Rename Task to CoroutineBrian Anderson-58/+58
2013-05-15core::rt: Rename Sched.task_queue to work_queueBrian Anderson-5/+5