summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2013-12-16vec: make the move iterator fast for all typesDaniel Micay-50/+47
Closes #10976
2013-12-15Register new snapshotsAlex Crichton-9/+1
Understand 'pkgid' in stage0. As a bonus, the snapshot now contains now metadata (now that those changes have landed), and the snapshot download is half as large as it used to be!
2013-12-15libstd: Fix merge fallout.Patrick Walton-1/+1
2013-12-15librustc: Remove identifiers named `box`, since it's about to become a keyword.Patrick Walton-70/+75
2013-12-15auto merge of #10984 : huonw/rust/clean-raw, r=cmrbors-211/+158
See commits for details.
2013-12-15std::vec: convert to(_mut)_ptr to as_... methods on &[] and &mut [].Huon Wilson-59/+68
2013-12-15Move std::{str,vec}::raw::set_len to an unsafe method on Owned{Vector,Str}.Huon Wilson-59/+61
2013-12-15std::vec: move pointless `raw::get` and `unsafe_get` functions.Huon Wilson-20/+4
This can easily be written as `(*v.unsafe_ref(i)).clone()`, or just `*v.unsafe_ref(i)` for primitive types like `i32` (the common case).
2013-12-15std::vec::raw: clean up docs.Huon Wilson-4/+6
2013-12-15std::vec::bytes: remove obsolete functions.Huon Wilson-44/+2
These are less useful versions of the comparison operators and TotalOrd trait.
2013-12-15std::vec: remove unnecessary count parameter on {bytes,Huon Wilson-28/+20
raw}::copy_memory. Slices carry their length with them, so we can just use that information.
2013-12-15std::rt: s/pausible/pausable/.Huon Wilson-18/+18
2013-12-15std: fix spelling in docs.Huon Wilson-50/+51
2013-12-14auto merge of #10936 : ↵bors-27/+52
cadencemarseille/rust/issue-10754-std-run-unwrap-on-None, r=alexcrichton The problem was that std::run::Process::new() was unwrap()ing the result of std::io::process::Process::new(), which returns None in the case where the io_error condition is raised to signal failure to start the process. Have std::run::Process::new() similarly return an Option\<run::Process\> to reflect the fact that a subprocess might have failed to start. Update utility functions run::process_status() and run::process_output() to return Option\<ProcessExit\> and Option\<ProcessOutput\>, respectively. Various parts of librustc and librustpkg needed to be updated to reflect these API changes. closes #10754
2013-12-14auto merge of #10870 : ktt3ja/rust/issue-10865, r=alexcrichtonbors-0/+1
Fix #10865 and #10939.
2013-12-14Fix #10754 - `std::run` functions fail after io_errorCadence Marseille-27/+52
The problem was that std::run::Process::new() was unwrap()ing the result of std::io::process::Process::new(), which returns None in the case where the io_error condition is raised to signal failure to start the process. Have std::run::Process::new() similarly return an Option<run::Process> to reflect the fact that a subprocess might have failed to start. Update utility functions run::process_status() and run::process_output() to return Option<ProcessExit> and Option<ProcessOutput>, respectively. Various parts of librustc and librustpkg needed to be updated to reflect these API changes. closes #10754
2013-12-14auto merge of #10949 : fabricedesre/rust/no-gnustl, r=cmrbors-1/+0
2013-12-15Rename To{Str,Bytes}Consume traits to Into*.Chris Morgan-7/+7
That is: - `ToStrConsume` → `IntoStr`; - `ToBytesConsume` → `IntoBytes`.
2013-12-14Remove {As,Into,To}{Option,Either,Result} traits.Chris Morgan-441/+0
Expanded, that is: - `AsOption` - `IntoOption` - `ToOption` - `AsEither` - `IntoEither` - `ToEither` - `AsResult` - `IntoResult` - `ToResult` These were defined for each other but never *used* anywhere. They are all trivial and so removal will have negligible effect upon anyone. `Either` has fallen out of favour (and its implementation of these traits of dubious semantics), `Option<T>` → `Result<T, ()>` was never really useful and `Result<T, E>` → `Option<T>` should now be done with `Result.ok()` (mirrored with `Result.err()` for even more usefulness). In summary, there's really no point in any of these remaining.
2013-12-14Dead-code pass now marks and warns foreign itemsKiet Tran-0/+1
2013-12-13auto merge of #10918 : eddyb/rust/inline-finally-dtor, r=thestingerbors-0/+56
* fixes the vec::from_elem regression caused by #8780 * added 5 benchmarks for allocating a 1KB `~[u8]` and zeroing it * closes #7136
2013-12-13auto merge of #10895 : sfackler/rust/io-util, r=alexcrichtonbors-0/+298
This adds a bunch of useful Reader and Writer implementations. I'm not a huge fan of the name `util` but I can't think of a better name and I don't want to make `std::io` any longer than it already is.
2013-12-12Remove dependency on gnustl_shared for android buildsFabrice Desré-1/+0
2013-12-12Inline Finallyalizer::drop, allowing LLVM to optimize `finally`.Eduard Burtescu-0/+56
* fixes the vec::from_elem regression caused by #8780 * added 5 benchmarks for allocating a 1KB ~[u8] and zeroing it
2013-12-11Add std::io::utilSteven Fackler-0/+298
This adds a bunch of useful Reader and Writer implementations. I'm not a huge fan of the name `util` but I can't think of a better name and I don't want to make `std::io` any longer than it already is.
2013-12-11Make 'self lifetime illegal.Erik Price-555/+555
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-12-11std::io: Add Buffer.lines(), change .bytes() apiklutzy-52/+136
- `Buffer.lines()` returns `LineIterator` which yields line using `.read_line()`. - `Reader.bytes()` now takes `&mut self` instead of `self`. - `Reader.read_until()` swallows `EndOfFile`. This also affects `.read_line()`.
2013-12-10auto merge of #10791 : pcwalton/rust/decelling, r=pcwaltonbors-741/+683
34 uses of `Cell` remain. r? @alexcrichton
2013-12-10libstd: Remove `Cell` from the library.Patrick Walton-74/+19
2013-12-10Make crate hash stable and externally computable.Jack Moffitt-5/+5
This replaces the link meta attributes with a pkgid attribute and uses a hash of this as the crate hash. This makes the crate hash computable by things other than the Rust compiler. It also switches the hash function ot SHA1 since that is much more likely to be available in shell, Python, etc than SipHash. Fixes #10188, #8523.
2013-12-10libstd: Remove two uses of `Cell`.Patrick Walton-6/+4
2013-12-10libstd: Change `atomically` to use RAII.Patrick Walton-54/+78
2013-12-10librustuv: Change `with_local_io` to use RAII.Patrick Walton-156/+181
2013-12-10libstd: Remove `Cell`s that were used because of `finally` by convertingPatrick Walton-41/+63
their `finally` blocks to RAII.
2013-12-10librustpkg: Make `io::ignore_io_error()` use RAII; remove a few morePatrick Walton-21/+37
cells.
2013-12-10libstd: Remove some cells involved inPatrick Walton-18/+12
`deschedule_running_task_and_then`.
2013-12-10librustuv: RAII-ify `Local::borrow`, and remove some 12 Cells.Patrick Walton-159/+181
2013-12-10libextra: Another round of de-`Cell`-ing.Patrick Walton-228/+124
34 uses of `Cell` remain.
2013-12-10Implement PortReader and ChanWriterRaphael Speyer-11/+172
2013-12-09auto merge of #10840 : cmr/rust/any_docs2, r=huonwbors-1/+8
2013-12-09Add some Any docs.Corey Richardson-1/+8
2013-12-09auto merge of #10859 : huonw/rust/helper-dists, r=cmrbors-246/+568
This moves `std::rand::distribitions::{Normal, StandardNormal}` to `...::distributions::normal`, reexporting `Normal` from `distributions` (and similarly for `Exp` and Exp1`), and adds: - Log-normal - Chi-squared - F - Student T all of which are implemented in C++11's random library. Tests in https://github.com/huonw/random-tests/commit/0424b8aded5e608ae386c1f917934a726d9cac6a. Note that these are approximately half documentation & half implementation (of which a significant portion is boilerplate `}`'s and so on).
2013-12-08std::rand: implement the student t distribution.Huon Wilson-1/+52
2013-12-08std::rand: implement the F distribution.Huon Wilson-1/+60
2013-12-08std::rand: implement the chi-squared distribution.Huon Wilson-2/+99
2013-12-08Remove dead codesKiet Tran-165/+38
2013-12-07std::rand: implement the log-normal distribution.Huon Wilson-2/+58
2013-12-07std::rand: move normal and exponential to their own file.Huon Wilson-244/+303
2013-12-07auto merge of #10824 : huonw/rust/str-doc, r=alexcrichtonbors-42/+321
Fixes #10819.
2013-12-06auto merge of #10364 : Kimundi/rust/result_compose, r=alexcrichtonbors-125/+44
This implements parts of the changes to `Result` and `Option` I proposed and discussed in this thread: https://mail.mozilla.org/pipermail/rust-dev/2013-November/006254.html This PR includes: - Adding `ok()` and `err()` option adapters for both `Result` variants. - Removing `get_ref`, `expect` and iterator constructors for `Result`, as they are reachable with the variant adapters. - Removing `Result`s `ToStr` bound on the error type because of composability issues. (See https://mail.mozilla.org/pipermail/rust-dev/2013-November/006283.html) - Some warning cleanups