about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2013-05-20Remove two warnings about unneccesary safe blocks.Steve Klabnik-6/+2
Since a snapshot was done last night, these are good to go.
2013-05-19Register snapshotsBrian Anderson-1814/+0
2013-05-19auto merge of #6106 : thestinger/rust/iter, r=bstriebors-16/+11
I don't have a strong opinion on the function vs. method, but there's no point in having both. I'd like to make a `repeat` adaptor like Python/Haskell for turning a value into an infinite stream of the value, so this has to at least be renamed.
2013-05-19Use assert_eq! rather than assert! where possibleCorey Richardson-547/+547
2013-05-18auto merge of #6577 : brson/rust/io-upstream, r=pcwaltonbors-16/+9
r? This is all of my scheduler work on #4419 from the last 3 weeks or so. I've had a few failed pull requests so far but I think the problems are ironed out. * TCP * The beginnings of runtime embedding APIs * Porting various corners of core to be compatible with both schedulers * libuv timer bindings * Further refinement of I/O error handling, including a new, incomplete, `read_error` condition * Incomplete refactoring to make tasks work without coroutines and user-space scheduling * Implementations of Reader/Writer extension methods * Implementations of the most important part of core::comm I'm particularly happy with how easy the [comm types on top of the scheduler](https://github.com/brson/rust/blob/io-upstream/src/libcore/rt/comm.rs). Note that these implementations do not use pipes. If anything here needs careful review though it's this code. This branch passes 95% of the run-pass tests (with `TESTARGS=--newrt`) In the next week I'll probably spend some time adding preliminary multithreading and seeing how close we are to removing the old runtime.
2013-05-18Remove trailing whitespacesOlivier Saut-1/+1
2013-05-18replace old_iter::repeat with the Times traitDaniel Micay-16/+11
2013-05-17core: Wire up oneshot pipes to newschedBrian Anderson-12/+5
2013-05-17Merge remote-tracking branch 'brson/io' into incomingBrian Anderson-4/+4
2013-05-17Correct the example given for a future, add punctuation where necessaryOlivier Saut-6/+8
2013-05-18rustc: relax limits on (u)int type limit lint. Fixes #6130.Huon Wilson-1/+1
2013-05-16auto merge of #6520 : thestinger/rust/rc, r=pcwaltonbors-42/+66
This is still enough to prevent cycles (explanation given in the docstring).
2013-05-15allow constructing Rc/RcMut from Const types tooDaniel Micay-42/+66
2013-05-16syntax: deprecate #[auto_{en,de}code] in favour of #[deriving({En,De}codable)].Huon Wilson-18/+6
Replace all instances of #[auto_*code] with the appropriate #[deriving] attribute and remove the majority of the actual code, leaving stubs to refer the user to the new syntax.
2013-05-15auto merge of #6498 : thestinger/rust/deep_clone, r=thestingerbors-5/+73
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-4/+4
2013-05-15core::rt: Add uv timer bindingsBrian Anderson-4/+4
2013-05-15auto merge of #6487 : recrack/rust/vec_len, r=thestingerbors-29/+25
Rename vec::len(var) to var.len() ``` libcore, libfuzzer, librustc, librustdoc, libstd, libsyntax test/auxiliary test/bench test/run-pass ```
2013-05-15rc: fix testsDaniel Micay-15/+7
2013-05-15add a DeepClone traitDaniel Micay-4/+80
for deep copies through shared ownership boundaries
2013-05-15Rename vec::len(var) to var.len()Youngmin Yoo-29/+25
2013-05-14auto merge of #6333 : bjz/rust/cond-macro, r=thestingerbors-28/+24
Addressing issue #6037, this Scheme-style conditional helps to improve code clarity in instances where the `if`, `else if`, and `else` keywords obscure predicates undesirably. Here is an example: ~~~rust let clamped = if x > mx { mx } else if x < mn { mn } else { x }; ~~~ Using `cond!`, the above could be written as: ~~~rust let clamped = cond!( (x > mx) { mx } (x < mn) { mn } _ { x } ); ~~~ The optional default case is denoted by `_`. I have altered `std::fun_treemap` to demonstrate it in use. I am definitely interested in using it for some of the numeric functions, but I will have to wait for it to reach `stage0` first.
2013-05-15Use parentheses for cond! macro instead of preceding pipesBrendan Zabarauskas-4/+4
This is temporary. Once the macro parser has improved or been re-written these can be removed.
2013-05-14auto merge of #6471 : gifnksm/rust/reform-rational, r=brsonbors-84/+126
`std::ratio` module contains `BigRational` type, but the type is not usable by following reasons. * `Ratio::new` requires `T: Copy + Num + Ord`, but `BigInt` is not implicitly copyable, because it contains unique vector. * `BigInt` is not implements `Num` So, I rewrite `Ratio` as follows. * `Ratio` requires `T: Clone + Integer + Ord`. * `Copy` -> `Clone`: to be able to use `BigRational` * `Num` -> `Integer`: It is incorrect that a rational number constructed by two non-integer numbers. * `BigInt` implements `Num` and `Orderable` which are required by `Integer` bound
2013-05-15Add Scheme-style `cond!` macro to syntax::ext::expandBrendan Zabarauskas-28/+24
Addresses issue #6037
2013-05-14Ignore two failing flatpipes testsBrian Anderson-0/+2
2013-05-14rusti: Remove #[allow(vecs_implicitly_copyable)]Alex Crichton-4/+4
2013-05-14Fix cosmetics for fail!() callsMarvin Löbel-13/+8
2013-05-14Use static string with fail!() and remove fail!(fmt!())Björn Steinbrink-129/+123
fail!() used to require owned strings but can handle static strings now. Also, it can pass its arguments to fmt!() on its own, no need for the caller to call fmt!() itself.
2013-05-14libstd: Add tests for BigRationalgifnksm-20/+56
2013-05-14libstd: `Ratio` requires `Clone` instead of `Copy`gifnksm-23/+28
This allows creating `Ratio<T>` which `T` is non-implicitly copyable types such as `BigInt`.
2013-05-14libstd: `Rational` requires `Integer` as type bounds instead of `Num`gifnksm-53/+14
2013-05-14libstd: impl `Orderable` for `BigUint`/`BigInt`gifnksm-1/+37
2013-05-14libstd: impl Num for BigUint/BigIntgifnksm-0/+4
2013-05-13revert PriorityQueue to using init()Daniel Micay-56/+4
uninit() would result in potentially running a destructor on arbitrary memory if the Ord implementation throws
2013-05-13auto merge of #6387 : brson/rust/unstable, r=brsonbors-42/+44
r? @pcwalton * Move `SharedMutableState`, `LittleLock`, and `Exclusive` from `core::unstable` to `core::unstable::sync` * Modernize the `SharedMutableState` interface with methods * Rename `SharedMutableState` to `UnsafeAtomicRcBox` to match `RcBox`.
2013-05-13core: Rename SharedMutableState to UnsafeAtomicRcBoxBrian Anderson-41/+43
2013-05-13core: Move locks, atomic rc to unstable::syncBrian Anderson-4/+4
2013-05-12libstd: Fix merge fallout.Patrick Walton-4/+4
2013-05-12libsyntax: Remove `extern mod foo { ... }` from the language.Patrick Walton-82/+88
2013-05-11auto merge of #6429 : gifnksm/rust/bigint-is_even, r=catamorphismbors-1/+12
`BigUint::is_even()` didn't return correct value.
2013-05-11clean up the last bit of warningsCorey Richardson-5/+5
2013-05-11Warning policeTim Chevalier-91/+24
2013-05-12libstd: Fix BigUint::is_evengifnksm-1/+12
2013-05-11auto merge of #6389 : sonwow/rust/issue-3356, r=bstriebors-33/+33
Fix for #3356
2013-05-10auto merge of #6260 : alexcrichton/rust/issue-3466-no-swap, r=pcwaltonbors-108/+96
There may be a more efficient implementation of `core::util::swap_ptr`. The issue mentioned using `move_val_init`, but I couldn't figure out what that did, so I just used `copy_memory` a few times instead. I'm not exactly the best at reading LLVM generated by rust, but this does appear to be optimized away just as expected (when possible).
2013-05-10Stop using the '<->' operatorAlex Crichton-108/+96
2013-05-10auto merge of #6205 : brson/rust/flate, r=brsonbors-0/+108
r? @graydon I don't think this is necessary in core.
2013-05-10auto merge of #6223 : alexcrichton/rust/issue-6183, r=pcwaltonbors-52/+539
Closes #6183. The first commit changes the compiler's method of treating a `for` loop, and all the remaining commits are just dealing with the fallout. The biggest fallout was the `IterBytes` trait, although it's really a whole lot nicer now because all of the `iter_bytes_XX` methods are just and-ed together. Sadly there was a huge amount of stuff that's `cfg(stage0)` gated, but whoever lands the next snapshot is going to have a lot of fun deleting all this code!
2013-05-10test: Use the new `for` protocolAlex Crichton-2/+74