summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
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
2013-05-10Move flate from core to stdBrian Anderson-0/+108
2013-05-10renamed str::from_slice to str::to_ownedYoungsoo Son-28/+28
2013-05-10auto merge of #6358 : crabtw/rust/mips-segstk, r=brsonbors-0/+1
I changed ```RED_ZONE_SIZE``` to ```RZ_MAC_32``` because of stack canary failure. Here is a LLVM patch for MIPS segmented stacks. http://people.cs.nctu.edu.tw/~jyyou/rust/mips-segstk.patch Current test results ``` failures: rand::tests::test_rng_seeded_custom_seed2 run::tests::test_forced_destroy_actually_kills run::tests::test_unforced_destroy_actually_kills time::tests::run_tests uv_ll::test::test_uv_ll_struct_size_addrinfo uv_ll::test::test_uv_ll_struct_size_uv_timer_t segfaults: rt::io::option::test::test_option_writer_error rt::local_services::test::unwind rt::sched::test_swap_tasks_then stackwalk::test_simple stackwalk::test_simple_deep ```
2013-05-10auto merge of #6329 : sonwow/rust/issue-6306, r=ILyoanbors-6/+6
Fix for #6306
2013-05-10renamed vec::from_slice to vec::to_ownedYoungsoo Son-5/+5
2013-05-09auto merge of #6339 : alexcrichton/rust/unsafe-cvec, r=catamorphismbors-4/+4
As noted by @jwise [here](https://github.com/mozilla/rust/commit/52445129fdb4ee847332acbf516ced8f73b7990a#commitcomment-3172192), it's probably a good idea to keep these unsafe. The lint check won't warn about these because it ignore `unsafe fn` declarations.
2013-05-10rustc: Use the new `for` protocolAlex Crichton-0/+33
2013-05-10std: Use the new `for` protocolAlex Crichton-51/+433
2013-05-10Move core::task::local_data to core::local_dataYoungsoo Son-6/+6
2013-05-09auto merge of #6354 : Aatch/rust/uninit-intrinsic, r=graydonbors-0/+84
Adds an `uninit` intrinsic. It's just an empty function, so llvm optimizes it down to nothing. I changed all of the `init` intrinsic usages to `uninit` where it seemed appropriate to.