about summary refs log tree commit diff
path: root/src/libstd/rt
AgeCommit message (Collapse)AuthorLines
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.
2013-09-11auto merge of #8999 : anasazi/rust/multi-threaded-io-tests, r=brsonbors-51/+190
Resolves #8685
2013-09-10Don't fail in TcpStream.flushSteven Fackler-1/+1
2013-09-10Buffered I/O wrappersSteven Fackler-0/+358
The default buffer size is the same as the one in Java's BufferedWriter. We may want BufferedWriter to have a Drop impl that flushes, but that isn't possible right now due to #4252/#4430. This would be a bit awkward due to the possibility of the inner flush failing. For what it's worth, Java's BufferedReader doesn't have a flushing finalizer, but that may just be because Java's finalizer support is awful. Closes #8953
2013-09-06Add with_mem_writer to std::rt::io::mem.Brandon Sanderson-0/+14
This is in many ways a replacement for the current std::io::with_str_writer.
2013-09-06Make I/O tests use run_in_mt_newsched_task to get more multi-threaded test ↵Eric Reed-50/+187
coverage
2013-09-06Forgot to make accept() home for IOEric Reed-1/+3
2013-09-06Upgrade libuv to the current master (again)Alex Crichton-124/+81
This is a reopening of the libuv-upgrade part of #8645. Hopefully this won't cause random segfaults all over the place. The windows regression in testing should also be fixed (it shouldn't build the whole compiler twice). A notable difference from before is that gyp is now a git submodule instead of always git-cloned at make time. This allows bundling for releases more easily. Closes #8850
2013-09-06Fix Acceptor iterator ending early if a connection attempt failsEric Reed-4/+9
2013-09-09rename `std::iterator` to `std::iter`Daniel Micay-6/+6
The trait will keep the `Iterator` naming, but a more concise module name makes using the free functions less verbose. The module will define iterables in addition to iterators, as it deals with iteration in general.
2013-09-07Handle global log levels (fixes #6033)novalis-36/+100
2013-09-06Fix #6031. Allow symbolic log levels, not just numbers.novalis-18/+53
2013-09-06auto merge of #9000 : brson/rust/dns, r=anasazibors-15/+382
This exposes a very simple function for resolving host names. There's a lot more that needs to be done, but this is probably enough for servo to get started connecting to real websites again.
2013-09-05std::rt: Fix addrinfo definition on BSDBrian Anderson-1/+15
2013-09-05auto merge of #8997 : fhahn/rust/issue_8985, r=catamorphism,brsonbors-12/+12
Patch for #8985
2013-09-05std::rt: Add get_host_addresses functionBrian Anderson-10/+78
This is a very simplistic method for host name resolution. It converts a host name to a vector of IP addresses. Should be enough to get started.
2013-09-05std::rt: Add libuv bindings for getaddrinfoBrian Anderson-0/+282
2013-09-05std::rt: Some I/O cleanupBrian Anderson-7/+10
2013-09-05Rename str::from_bytes to str::from_utf8, closes #8985Florian Hahn-12/+12
2013-09-05Implement Stream automatically for Reader + WriterChris Morgan-0/+2
This is consistent with the existing documentation but was not the actual behaviour, which I've found to be rather a nuisance, actually.
2013-09-04auto merge of #8977 : pnkfelix/rust/fsk-followup-on-6009-rebased, r=alexcrichtonbors-5/+3
Fix #6009. Rebased version of #8970. Inherits review from alexcrichton.
2013-09-04auto merge of #8935 : blake2-ppc/rust/reader-bytes, r=brsonbors-1/+89
An iterator that simply calls `.read_bytes()` each iteration. I think choosing to own the Reader value and implementing Decorator to allow extracting it is the most generically useful. The Reader type variable can of course be some kind of reference type that implements Reader. In the generic form the `Bytes` iterator is well behaved itself and does not read ahead. It performs abysmally on top of a FileStream, and much better if a buffering reader is inserted inbetween.
2013-09-04auto merge of #8880 : fhahn/rust/issue_8703, r=brsonbors-15/+248
I've started working on #8703. RUST_LOG="::help" should work, I hope I'll be able to finish the rest this weekend.
2013-09-04Convert rust_log.cpp to Rust, closes #8703Florian Hahn-15/+248
2013-09-04stop treating char as an integer typeDaniel Micay-6/+7
Closes #7609
2013-09-04Added explicit pub to several conditions. Enables completion of #6009.Felix S. Klock II-5/+3
2013-09-03auto merge of #8943 : alexcrichton/rust/issue-8904, r=brsonbors-2/+8
We already do this for libstd tests automatically, and compiletest runs into the same problems where when forking lots of processes lots of file descriptors are created. On OSX we can use specific syscalls to raise the limits, in this situation, though. Closes #8904
2013-09-03auto merge of #8963 : jmgrosen/rust/issue-8881, r=alexcrichtonbors-0/+4
2013-09-03Fixes #8881. condition! imports parent's pub identifiersjmgrosen-0/+4
2013-09-03auto merge of #8954 : anasazi/rust/tcp-acceptor, r=catamorphismbors-160/+234
The Listener trait takes two type parameters, the type of connection and the type of Acceptor, and specifies only one method, listen, which consumes the listener and produces an Acceptor. The Acceptor trait takes one type parameter, the type of connection, and defines two methods. The accept() method waits for an incoming connection attempt and returns the result. The incoming() method creates an iterator over incoming connections and is a default method. Example: ```rust let listener = TcpListener.bind(addr); // Bind to a socket let acceptor = listener.listen(); // Start the listener for stream in acceptor.incoming() { // Process incoming connections forever (a failure will kill the task). } ``` Closes #8689
2013-09-03rt::io: Rename Bytes to ByteIterator and add note about iterationblake2-ppc-8/+14
2013-09-02Raise the file descriptor limits when running compiletestAlex Crichton-2/+8
We already do this for libstd tests automatically, and compiletest runs into the same problems where when forking lots of processes lots of file descriptors are created. On OSX we can use specific syscalls to raise the limits, in this situation, though. Closes #8904
2013-09-02Implement BufReaderSteven Fackler-3/+39
2013-09-02rt::io: Add Bytes iterator for Readerblake2-ppc-1/+83
An iterator that simply calls `.read_bytes()` each iteration. I think choosing to own the Reader value and implementing Decorator to allow extracting it is the most generically useful. The Reader type variable can of course be some kind of reference type that implements Reader.
2013-08-30auto merge of #8854 : huonw/rust/rt-papercuts, r=brsonbors-31/+25
The only user-facing change is handling non-integer (and zero) `RUST_THREADS` more nicely: ``` $ RUST_THREADS=x rustc # old You've met with a terrible fate, haven't you? fatal runtime error: runtime tls key not initialized Aborted $ RUST_THREADS=x ./x86_64-unknown-linux-gnu/stage2/bin/rustc # new You've met with a terrible fate, haven't you? fatal runtime error: `RUST_THREADS` is `x`, should be a positive integer Aborted ``` The other changes are converting some `for .. in range(x,y)` to `vec::from_fn` or `for .. in x.iter()` as appropriate; and removing a chain of (seemingly) unnecessary pointer casts. (Also, fixes a typo in `extra::test` from #8823.)