about summary refs log tree commit diff
path: root/src/libstd/rt
AgeCommit message (Collapse)AuthorLines
2013-09-20auto merge of #9320 : ↵bors-2/+1
chris-morgan/rust/unreachable-macro-part-two-of-two-containing-the-destruction-of-the-unreachable-function, r=alexcrichton This is the second of two parts of #8991, now possible as a new snapshot has been made. (The first part implemented the unreachable!() macro; it was #8992, 6b7b8f2682.) ``std::util::unreachable()`` is removed summarily; any code which used it should now use the ``unreachable!()`` macro. Closes #9312. Closes #8991.
2013-09-19Ignore io::process testsAlex Crichton-0/+6
They're causing syscalls to get interrupted, and std::io doesn't correctly handle EINTR
2013-09-19Replace unreachable() calls with unreachable!().Chris Morgan-2/+1
This is the second of two parts of #8991, now possible as a new snapshot has been made. (The first part implemented the unreachable!() macro; it was #8992, 6b7b8f2682.) ``std::util::unreachable()`` is removed summarily; any code which used it should now use the ``unreachable!()`` macro. Closes #9312. Closes #8991.
2013-09-18Implement process bindings to libuvAlex Crichton-67/+1034
This is a re-landing of #8645, except that the bindings are *not* being used to power std::run just yet. Instead, this adds the bindings as standalone bindings inside the rt::io::process module. I made one major change from before, having to do with how pipes are created/bound. It's much clearer now when you can read/write to a pipe, as there's an explicit difference (different types) between an unbound and a bound pipe. The process configuration now takes unbound pipes (and consumes ownership of them), and will return corresponding pipe structures back if spawning is successful (otherwise everything is destroyed normally).
2013-09-18Register new snapshotsAlex Crichton-82/+6
2013-09-17auto merge of #9235 : olsonjeffery/rust/newrt_file_io_1, r=thestingerbors-221/+1337
A quick rundown: - added `file::{readdir, stat, mkdir, rmdir}` - Added access-constrained versions of `FileStream`; `FileReader` and `FileWriter` respectively - big rework in `uv::file` .. most actions are by-val-self methods on `FsRequest`; `FileDescriptor` has gone the way of the dinosaurs - playing nice w/ homing IO (I just copied ecr's work, hehe), etc - added `FileInfo` trait, with an impl for `Path` - wrapper for file-specific actions, with the file path always implied by self's value - has the means to create `FileReader` & `FileWriter` (this isn't exposed in the top-level free function API) - has "safe" wrappers for `stat()` that won't throw in the event of non-existence/error (in this case, I mean `is_file` and `exists`) - actions should fail if done on non-regular-files, as appropriate - added `DirectoryInfo` trait, with an impl for `Path` - pretty much ditto above, but for directories - added `readdir` (!!) to iterate over entries in a dir as a `~[Path]` (this was *brutal* to get working) ...<del>and lots of other stuff</del>not really. Do your worst!
2013-09-17std: whitespace clean up io::file docsJeff Olson-52/+52
2013-09-17remove unnecessary transmutesDaniel Micay-20/+7
2013-09-17std: remove RtioStreamJeff Olson-5/+0
2013-09-17auto merge of #9244 : thestinger/rust/drop, r=catamorphismbors-19/+19
This doesn't close any bugs as the goal is to convert the parameter to by-value, but this is a step towards being able to make guarantees about `&T` pointers (where T is Freeze) to LLVM.
2013-09-16std: docstring fixes in io::fileJeff Olson-239/+259
2013-09-16std: minor cleanup in some io_error descs in io::fileJeff Olson-2/+2
2013-09-16std: lots of docs for std::rt::io::fileJeff Olson-52/+298
i hope they don't bitrot
2013-09-16std: FsRequest.req_boilerplate() be &mut selfJeff Olson-17/+58
2013-09-16std: remove impl'd/commented-out fstat signaturesJeff Olson-4/+0
2013-09-16std: generlize & move io::file::suppressed_stat to io::ignore_io_errorJeff Olson-19/+19
2013-09-16std: correctly pass STDOUT in to naive_print test fnJeff Olson-1/+1
2013-09-16std: unignore some file io tests that work on windows, nowJeff Olson-6/+0
2013-09-16std: bind uv_fs_readdir(), flesh out DirectoryInfo and docs/cleanupJeff Olson-16/+173
2013-09-16std: expose more stat infoJeff Olson-7/+7
2013-09-16std: clean up Dir/FileInfo inheritence and flesh out Dir InfoJeff Olson-59/+129
2013-09-16std: adding file::{stat,mkdir,rmdir}, FileInfo and FileReader/FileWriterJeff Olson-131/+269
add ignores for win32 tests on previous file io stuff...
2013-09-16merge cleanupJeff Olson-1/+2
2013-09-16std/rt: in-progress file io workJeff Olson-203/+661
std: remove unneeded field from RequestData struct std: rt::uv::file - map us_fs_stat & start refactoring calls into FsRequest std: stubbing out stat calls from the top-down into uvio std: us_fs_* operations are now by-val self methods on FsRequest std: post-rebase cleanup std: add uv_fs_mkdir|rmdir + tests & minor test cleanup in rt::uv::file WORKING: fleshing out FileStat and FileInfo + tests std: reverting test files.. refactoring back and cleanup...
2013-09-16auto merge of #9108 : blake2-ppc/rust/hazards-on-overflow, r=alexcrichtonbors-1/+1
Fix uint overflow bugs in std::{at_vec, vec, str} Closes #8742 Fix issue #8742, which summarized is: unsafe code in vec and str did assume that a reservation for `X + Y` elements always succeeded, and didn't overflow. Introduce the method `Vec::reserve_additional(n)` to make it easy to check for overflow in `Vec::push` and `Vec::push_all`. In std::str, simplify and remove a lot of the unsafe code and use `push_str` instead. With improvements to `.push_str` and the new function `vec::bytes::push_bytes`, it looks like this change has either no or positive impact on performance. I believe there are many places still where `v.reserve(A + B)` still can overflow. This by itself is not an issue unless followed by (unsafe) code that steps aside boundary checks.
2013-09-16switch Drop to `&mut self`Daniel Micay-19/+19
2013-09-17rt::io: Use vec::reserve_additionalblake2-ppc-1/+1
2013-09-16auto merge of #9211 : klutzy/rust/win32-fix, r=alexcrichtonbors-16/+38
2013-09-16Add an SendStr typeMarvin Löbel-10/+5
A SendStr is a string that can hold either a ~str or a &'static str. This can be useful as an optimization when an allocation is sometimes needed but the common case is statically known. Possible use cases include Maps with both static and owned keys, or propagating error messages across task boundaries. SendStr implements most basic traits in a way that hides the fact that it is an enum; in particular things like order and equality are only determined by the content of the wrapped strings. Replaced std::rt:logging::SendableString with SendStr Added tests for using an SendStr as key in Hash- and Treemaps
2013-09-16std::rt::uv::file: Enable tests on Win32klutzy-2/+0
Closes #8814.
2013-09-16std::rt::uv::uvio: Enable tests on Win32klutzy-2/+0
Closes #8816.
2013-09-16std::rt::io::net::tcp: Fix one tcp test on Win32klutzy-2/+7
Fixes `connect_error` part of #8811.
2013-09-16std::rt::uv::uvll: Fix uv_req_type on Win32klutzy-3/+27
Also enables request_sanity_check() test. Closes #8817
2013-09-16std::rt::io::support: Fix ignored test on Win32klutzy-2/+1
Assumes drive C: exists. Closes #8812.
2013-09-15std::rt::io::file: Enable I/O tests on Win32klutzy-5/+3
Enable blocked tests which are now fixed by #9165. Closes #8810.
2013-09-15Remove {uint,int,u64,i64,...}::from_str,from_str_radixblake2-ppc-3/+4
Remove these in favor of the two traits themselves and the wrapper function std::from_str::from_str. Add the function std::num::from_str_radix in the corresponding role for the FromStrRadix trait.
2013-09-14auto merge of #9191 : huonw/rust/are-you-tired, r=cmrbors-0/+14
Allows `std::rt::io::timer::sleep(1000)` rather than `std::rt::io::timer::Timer::new().unwrap().sleep(1000)`.
2013-09-14auto merge of #9180 : blake2-ppc/rust/reduce-either, r=catamorphismbors-11/+13
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 #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-1/+1
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-14std::logging: Use a more specific enum than Eitherblake2-ppc-11/+13
2013-09-13std::rt::io: Fix file I/O on Win32klutzy-0/+9
It was broken on win32 because of header inconsistency.
2013-09-12auto merge of #9087 : fhahn/rust/rust_crate_map, r=brsonbors-54/+213
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: Rename {Option,Result}::chain{,_err}* to {and_then,or_else}Erick Tryzelaar-1/+1
2013-09-13Convert rust_crate_map.cpp to RustFlorian Hahn-54/+213
Conflicts: src/libstd/rt/logging.rs
2013-09-11auto merge of #9114 : sfackler/rust/flush-fix, r=brsonbors-1/+1
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.