summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2013-09-14iter: move Counter impl to the proper placeDaniel Micay-14/+14
2013-09-14iter: replace comment with a docstringDaniel Micay-5/+3
2013-09-14Add SharedPort wrapper around rt::comm::SharedPortFlavio Percoco-9/+38
SharedPort implementation was missing in std::comm. Since this module also wraps SharedChan, it makes sense to have SharedPort defined there as well.
2013-09-14iter: fix range docstringsDaniel Micay-2/+2
2013-09-14auto merge of #9182 : bjz/rust/master, r=brsonbors-0/+1
Somehow this was missed! cc #4819
2013-09-14auto merge of #9180 : blake2-ppc/rust/reduce-either, r=catamorphismbors-18/+18
Work a bit towards #9157 "Remove Either". These instances don't need to use Either and are better expressed in other ways (removing allocations and simplifying types).
2013-09-15std::rt: Add a standalone sleep function.Huon Wilson-0/+14
2013-09-14auto merge of #9165 : klutzy/rust/newrt-file-fix, r=sanxiynbors-0/+9
It was broken on win32 because of header inconsistency.
2013-09-14auto merge of #9160 : alexcrichton/rust/local-data-docs, r=huonwbors-7/+8
Remove references to local_data::Key and only mention the macro for how to construct new keys into local data.
2013-09-14auto merge of #9156 : sfackler/rust/buffered-fix, r=huonwbors-13/+19
This is a workaround for #9155. Currently, any uses of BufferedStream outside of libstd ICE.
2013-09-14auto merge of #9115 : erickt/rust/master, r=ericktbors-98/+833
This is a series of patches to modernize option and result. The highlights are: * rename `.unwrap_or_default(value)` and etc to `.unwrap_or(value)` * add `.unwrap_or_default()` that uses the `Default` trait * add `Default` implementations for vecs, HashMap, Option * add `Option.and(T) -> Option<T>`, `Option.and_then(&fn() -> Option<T>) -> Option<T>`, `Option.or(T) -> Option<T>`, and `Option.or_else(&fn() -> Option<T>) -> Option<T>` * add `option::ToOption`, `option::IntoOption`, `option::AsOption`, `result::ToResult`, `result::IntoResult`, `result::AsResult`, `either::ToEither`, and `either::IntoEither`, `either::AsEither` * renamed `Option::chain*` and `Result::chain*` to `and_then` and `or_else` to avoid the eventual collision with `Iterator.chain`. * Added a bunch of impls of `Default` * Added a `#[deriving(Default)]` syntax extension * Removed impls of `Zero` for `Option<T>` and vecs.
2013-09-13Remove all usage of change_dir_lockedAlex Crichton-53/+0
While usage of change_dir_locked is synchronized against itself, it's not synchronized against other relative path usage, so I'm of the opinion that it just really doesn't help in running tests. In order to prevent the problems that have been cropping up, this completely removes the function. All existing tests (except one) using it have been moved to run-pass tests where they get their own process and don't need to be synchronized with anyone else. There is one now-ignored rustpkg test because when I moved it to a run-pass test apparently run-pass isn't set up to have 'extern mod rustc' (it ends up having linkage failures).
2013-09-14Add Orderable bound to num::PrimitiveBrendan Zabarauskas-0/+1
2013-09-14std::logging: Use a more specific enum than Eitherblake2-ppc-18/+18
2013-09-13std: Fix another windows problem with the unwrap_or_default renameErick Tryzelaar-1/+1
2013-09-13std: rename Option.chain to Option.and_then on windowsErick Tryzelaar-1/+1
2013-09-13std::rt::io: Fix file I/O on Win32klutzy-0/+9
It was broken on win32 because of header inconsistency.
2013-09-12Improve the local_data docs slightlyAlex Crichton-7/+8
Remove references to local_data::Key and only mention the macro for how to construct new keys into local data.
2013-09-12auto merge of #9087 : fhahn/rust/rust_crate_map, r=brsonbors-54/+224
This patch converts the rust_crate_map.cpp to Rust as mentioned at the end of #8880.
2013-09-12Stop using newtypes in rt::io::bufferedSteven Fackler-13/+19
This is a workaround for #9155. Currently, any uses of BufferedStream outside of libstd ICE.
2013-09-12std: Restore Option::chain{,_mut}_ref as and_then{,_mut}_refErick Tryzelaar-16/+26
2013-09-12std: Remove Zero impl for OptionErick Tryzelaar-5/+0
Options are not numeric types, so it doesn't make sense for them to implement Zero.
2013-09-12std: Remove Zero impl from vecErick Tryzelaar-21/+4
Vecs are not numeric types, so it doesn't make sense for them to implement Zero.
2013-09-12std: Add a bunch of Default implsErick Tryzelaar-5/+75
2013-09-12std: Rename {Option,Result}::chain{,_err}* to {and_then,or_else}Erick Tryzelaar-55/+79
2013-09-12std: Add ToEither/IntoEither/AsEitherErick Tryzelaar-21/+162
2013-09-12std: Add ToResult/IntoResult/AsResultErick Tryzelaar-12/+171
2013-09-12std: Add ToOption/IntoOption/AsOptionErick Tryzelaar-0/+185
2013-09-12std: fix a warningErick Tryzelaar-1/+1
2013-09-12std: Add Option.{and,and_then,or,or_else}Erick Tryzelaar-8/+81
2013-09-12std: Add Option.unwrap_or_else and a couple testsErick Tryzelaar-0/+47
2013-09-12std: Add Default implementation for vecsErick Tryzelaar-0/+14
2013-09-12std: Add Option.{result_or_default,or_default} that uses DefaultErick Tryzelaar-0/+20
2013-09-12std: add default implementations to OptionErick Tryzelaar-0/+5
2013-09-12std: add default implementations to HashMapErick Tryzelaar-0/+9
2013-09-12std: rename Option::unwrap_or_default() to unwrap_or()Erick Tryzelaar-4/+4
2013-09-13Convert rust_crate_map.cpp to RustFlorian Hahn-54/+213
Conflicts: src/libstd/rt/logging.rs
2013-09-12auto merge of #9136 : thestinger/rust/ptr, r=alexcrichtonbors-4/+64
This is mostly for consistency, as you can now compare raw pointers in constant expressions or without the standard library. It also reduces the number of `ptrtoint` instructions in the IR, making tracking down culprits of what's usually an anti-pattern easier.
2013-09-12auto merge of #9140 : alexcrichton/rust/issue-9119, r=huonwbors-2/+2
Closes #9119
2013-09-12auto merge of #9012 : alexcrichton/rust/format-args, r=huonwbors-16/+75
The purpose of this macro is to further reduce the number of allocations which occur when dealing with formatting strings. This macro will perform all of the static analysis necessary to validate that a format string is safe, and then it will wrap up the "format string" into an opaque struct which can then be passed around. Two safe functions are added (write/format) which take this opaque argument structure, unwrap it, and then call the unsafe version of write/format (in an unsafe block). Other than these two functions, it is not intended for anyone to ever look inside this opaque struct. The macro looks a bit odd, but mostly because of rvalue lifetimes this is the only way for it to be safe that I know of. Example use-cases of this are: * third-party libraries can use the default formatting syntax without any forced allocations * the fail!() macro can avoid allocating the format string * the logging macros can avoid allocation any strings I plan on transitioning the standard logging/failing to using these macros soon. This is currently blocking on inner statics being usable in cross-crate situations (still tracking down bugs there), but this will hopefully be coming soon! Additionally, I'd rather settle on a name now than later, so if anyone has a better suggestion other than `format_args`, I'm not attached to the name at all :)
2013-09-12auto merge of #9138 : alexcrichton/rust/dynamic-lib-not-threadsafe, r=thestingerbors-1/+3
The library isn't thread-safe, cc #9137
2013-09-12Parse underscores in identifiers for format!Alex Crichton-2/+2
Closes #9119
2013-09-12Implement a format_args!() macroAlex Crichton-16/+75
The purpose of this macro is to further reduce the number of allocations which occur when dealing with formatting strings. This macro will perform all of the static analysis necessary to validate that a format string is safe, and then it will wrap up the "format string" into an opaque struct which can then be passed around. Two safe functions are added (write/format) which take this opaque argument structure, unwrap it, and then call the unsafe version of write/format (in an unsafe block). Other than these two functions, it is not intended for anyone to ever look inside this opaque struct. The macro looks a bit odd, but mostly because of rvalue lifetimes this is the only way for it to be safe that I know of. Example use-cases of this are: * third-party libraries can use the default formatting syntax without any forced allocations * the fail!() macro can avoid allocating the format string * the logging macros can avoid allocation any strings
2013-09-11Flag the dynamic_lib tests as ignoredAlex Crichton-1/+3
The library isn't thread-safe, cc #9137
2013-09-11auto merge of #9114 : sfackler/rust/flush-fix, r=brsonbors-1/+1
2013-09-12implement raw pointer comparisons in librustcDaniel Micay-4/+64
This is mostly for consistency, as you can now compare raw pointers in constant expressions or without the standard library. It also reduces the number of `ptrtoint` instructions in the IR, making tracking down culprits of what's usually an anti-pattern easier.
2013-09-11auto merge of #9038 : singingboyo/rust/with-mem-writer, r=anasazibors-0/+14
This is in many ways a replacement for the current std::io::with_str_writer.
2013-09-11auto merge of #8999 : anasazi/rust/multi-threaded-io-tests, r=brsonbors-51/+190
Resolves #8685
2013-09-11Add HashSet::with_capacity_and_keys() functionFlorian Hahn-0/+11
This function can be use to create HashSets before the tls is initialized.
2013-09-10Don't fail in TcpStream.flushSteven Fackler-1/+1