about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2015-04-08Rollup merge of #24167 - hauleth:remove-incorrect-example-from-mpsc, ↵Steve Klabnik-52/+0
r=steveklabnik As beta is now released and is "suggested" version of `rustc` then there should be no code (in documentation) that will not compile with it. This one does not. So according to [this great talk](http://delete-your-code.herokuapp.com/), I am doing what should be done.
2015-04-08Auto merge of #23293 - tbu-:pr_additive_multiplicative, r=alexcrichtonbors-6/+4
Previously it could not be implemented for types outside `libcore/iter.rs` due to coherence issues.
2015-04-08Make `sum` and `product` inherent methods on `Iterator`Tobias Bucher-6/+4
In addition to being nicer, this also allows you to use `sum` and `product` for iterators yielding custom types aside from the standard integers. Due to removing the `AdditiveIterator` and `MultiplicativeIterator` trait, this is a breaking change. [breaking-change]
2015-04-07Remove another invalid exampleŁukasz Niemier-26/+0
2015-04-07Remove incorrect example from docsŁukasz Niemier-26/+0
2015-04-06Remove outdated notice from BufRead::lines docs.Matt Brubeck-3/+0
There is no `read_string` function, and `lines` never returns an error.
2015-04-04fixing some tests and temporarily disabling others to get Bitrig build ↵Dave Huseby-1/+2
working 100%
2015-04-04Rollup merge of #24022 - steveklabnik:hn_fix, r=nikomatsakisManish Goregaokar-3/+2
from https://news.ycombinator.com/item?id=9317822
2015-04-04Rollup merge of #23979 - Ryman:error_from_string, r=alexcrichtonManish Goregaokar-3/+10
2015-04-03Don't speak of old_ioSteve Klabnik-3/+2
from https://news.ycombinator.com/item?id=9317822
2015-04-03Auto merge of #23832 - petrochenkov:usize, r=aturonbors-10/+10
These constants are small and can fit even in `u8`, but semantically they have type `usize` because they denote sizes and are almost always used in `usize` context. The change of their type to `u32` during the integer audit led only to the large amount of `as usize` noise (see the second commit, which removes this noise). This is a minor [breaking-change] to an unstable interface. r? @aturon
2015-04-02std: impl From<String> for Box<Error + Send>Kevin Butler-3/+10
2015-04-02Auto merge of #23931 - steveklabnik:doc_std_fs, r=alexcrichtonbors-42/+306
2015-04-02Auto merge of #23877 - richo:gardening, r=Manishearthbors-2/+1
I also wanted to unignore https://github.com/rust-lang/rust/blob/master/src/libsyntax/ext/expand.rs#L1768-L1777 since the issue it references is closed, but the test fails, and it's internals aren't super clear to me.
2015-04-02Add more examples and documentation for std::fsSteve Klabnik-42/+306
2015-04-02Tweak relese notes + rebase fixesAlex Crichton-6/+6
2015-04-01Test fixes and rebase conflicts, round 2Alex Crichton-25/+25
2015-04-01rollup merge of #23176: huonw/rm-boundsAlex Crichton-34/+36
2015-04-01rollup merge of #23860: nikomatsakis/copy-requires-cloneAlex Crichton-18/+24
Conflicts: src/test/compile-fail/coherence-impls-copy.rs
2015-04-01rollup merge of #23945: pnkfelix/gate-u-negateAlex Crichton-3/+3
Feature-gate unsigned unary negate. Discussed in weekly meeting here: https://github.com/rust-lang/meeting-minutes/blob/master/weekly-meetings/2015-03-31.md#feature-gate--expr and also in the internals thread here: http://internals.rust-lang.org/t/forbid-unsigned-integer/752
2015-04-02Test fixes and rebase conflicts, round 2Alex Crichton-2/+2
Conflicts: src/libcore/num/mod.rs
2015-04-01rollup merge of #23949: aturon/stab-timeoutAlex Crichton-28/+54
This commit renames and stabilizes: * `Condvar::wait_timeout_ms` (renamed from `wait_timeout`) * `thread::park_timeout_ms` (renamed from `park_timeout`) * `thread::sleep_ms` (renamed from `sleep`) In each case, the timeout is taken as a `u32` number of milliseconds, rather than a `Duration`. These functions are likely to be deprecated once a stable form of `Duration` is available, but there is little cost to having these named variants around, and it's crucial functionality for 1.0. [breaking-change] r? @alexcrichton cc @sfackler @carllerche
2015-04-01Stabilize basic timeout functionalityAaron Turon-28/+54
This commit renames and stabilizes: * `Condvar::wait_timeout_ms` (renamed from `wait_timeout`) * `thread::park_timeout_ms` (renamed from `park_timeout`) * `thread::sleep_ms` (renamed from `sleep`) In each case, the timeout is taken as a `u32` number of milliseconds, rather than a `Duration`. These functions are likely to be deprecated once a stable form of `Duration` is available, but there is little cost to having these named variants around, and it's crucial functionality for 1.0. [breaking-change]
2015-04-01fallout from feature-gating unary negation on unsigned integers.Felix S. Klock II-1/+1
2015-04-01rollup merge of #23939: nikomatsakis/fn-boxAlex Crichton-57/+27
Conflicts: src/liballoc/boxed.rs
2015-04-01rollup merge of #23951: alexcrichton/splitnAlex Crichton-3/+3
This commit is an implementation of [RFC 979][rfc] which changes the meaning of the count parameter to the `splitn` function on strings and slices. The parameter now means the number of items that are returned from the iterator, not the number of splits that are made. [rfc]: https://github.com/rust-lang/rfcs/pull/979 Closes #23911 [breaking-change]
2015-04-01std: Changing the meaning of the count to splitnAlex Crichton-3/+3
This commit is an implementation of [RFC 979][rfc] which changes the meaning of the count parameter to the `splitn` function on strings and slices. The parameter now means the number of items that are returned from the iterator, not the number of splits that are made. [rfc]: https://github.com/rust-lang/rfcs/pull/979 Closes #23911 [breaking-change]
2015-04-01rollup merge of #23942: vhbit/ios-randAlex Crichton-2/+2
2015-04-01rollup merge of #23867: nikomatsakis/issue-23086-take-3Alex Crichton-1/+153
This PR implements rust-lang/rfcs#1023. In the process it fixes #23086 and #23516. A few impls in libcore had to be updated, but the impact is generally pretty minimal. Most of the fallout is in the tests that probed the limits of today's coherence. I tested and we were able to build the most popular crates along with iron (modulo errors around errors being sendable). Fixes #23918.
2015-04-01Collect the definition of the `Error` trait into `libstd` for now. ThisNiko Matsakis-1/+153
sidesteps a coherence difficulty where `liballoc` had to prove that `&str: !Error`, which didn't involve any local types.
2015-04-02Rollup merge of #23932 - steveklabnik:doc_std_path, r=flaper87Manish Goregaokar-0/+213
2015-04-02Rollup merge of #23847 - bcoopers:read_clarification, r=sfacklerManish Goregaokar-8/+4
This introduces no functional changes except for reducing a few unnecessary operations and variables. Vec has the behavior that, if you request space past the capacity with reserve(), it will round up to the nearest power of 2. What that effectively means is that after the first call to reserve(16), we are doubling our capacity every time. So using the DEFAULT_BUF_SIZE and doubling cap_size() here is meaningless and has no effect on the call to reserve(). Note that with #23842 implemented this will hopefully have a clearer API and less of a need for commenting. If #23842 is not implemented then the most clear implementation would be to call reserve_exact(buf.capacity()) at every step (and making sure that buf.capacity() is not zero at the beginning of the function of course). Edit- functional change now introduced. We will now zero 16 bytes of the vector first, then double to 32, then 64, etc. until we read 64kB. This stops us from zeroing the entire vector when we double it, some of which may be wasted work. Reallocation still follows the doubling strategy, but the responsibility has been moved to vec.extend(), which calls reserve() and push_back().
2015-04-01Remove `Thunk` struct and `Invoke` trait; change `Thunk` to be an aliasNiko Matsakis-57/+26
for `Box<FnBox()>`. I found the alias was still handy because it is shorter than the fully written type. This is a [breaking-change]: convert code using `Invoke` to use `FnBox`, which is usually pretty straight-forward. Code using thunk mostly works if you change `Thunk::new => Box::new` and `foo.invoke(arg)` to `foo(arg)`.
2015-04-01Add (unstable) FnBox trait as a nicer replacement for `Thunk`. The docNiko Matsakis-0/+1
comment includes a test that also shows how it can be used.
2015-04-01std: Unignore a test for #10663Richo Healey-2/+1
This issue is long closed. It seems that unwrapping will always panic though.
2015-04-01iOS: os::last_os_error() falloutValerii Hiora-2/+2
2015-04-01Fallout in public-facing and semi-public-facing libsNiko Matsakis-18/+24
2015-04-01Update android tests to reflect API switch from `os::env` to `env::vars`.Felix S. Klock II-4/+3
2015-04-01Test fixes and rebase conflictsAlex Crichton-7/+13
2015-04-01Add examples + documentation for std::pathSteve Klabnik-0/+213
2015-03-31rollup merge of #23863: pnkfelix/arith-oflo-const-evalAlex Crichton-1/+2
const_eval : add overflow-checking for {`+`, `-`, `*`, `/`, `<<`, `>>`}. One tricky detail here: There is some duplication of labor between `rustc::middle::const_eval` and `rustc_trans::trans::consts`. It might be good to explore ways to try to factor out the common structure to the two passes (by abstracting over the particular value-representation used in the compile-time interpreter). ---- Update: Rebased atop #23841 Fix #22531 Fix #23030 Fix #23221 Fix #23235
2015-04-01Fallout from changes for overflow-checking during constant evaluation.Felix S. Klock II-1/+2
2015-03-31Test fixes and rebase conflicts, round 3Alex Crichton-137/+139
2015-03-31rollup merge of #23919: alexcrichton/stabilize-io-errorAlex Crichton-52/+49
Conflicts: src/libstd/fs/tempdir.rs src/libstd/io/error.rs
2015-03-31std: Stabilize last bits of io::ErrorAlex Crichton-76/+50
This commit stabilizes a few remaining bits of the `io::Error` type: * The `Error::new` method is now stable. The last `detail` parameter was removed and the second `desc` parameter was generalized to `E: Into<Box<Error>>` to allow creating an I/O error from any form of error. Currently there is no form of downcasting, but this will be added in time. * An implementation of `From<&str> for Box<Error>` was added to liballoc to allow construction of errors from raw strings. * The `Error::raw_os_error` method was stabilized as-is. * Trait impls for `Clone`, `Eq`, and `PartialEq` were removed from `Error` as it is not possible to use them with trait objects. This is a breaking change due to the modification of the `new` method as well as the removal of the trait implementations for the `Error` type. [breaking-change]
2015-03-31rollup merge of #23288: alexcrichton/issue-19470Alex Crichton-19/+18
This is a deprecated attribute that is slated for removal, and it also affects all implementors of the trait. This commit removes the attribute and fixes up implementors accordingly. The primary implementation which was lost was the ability to compare `&[T]` and `Vec<T>` (in that order). This change also modifies the `assert_eq!` macro to not consider both directions of equality, only the one given in the left/right forms to the macro. This modification is motivated due to the fact that `&[T] == Vec<T>` no longer compiles, causing hundreds of errors in unit tests in the standard library (and likely throughout the community as well). Closes #19470 [breaking-change]
2015-03-31rollup merge of #23908: aturon/stab-more-stragglersAlex Crichton-8/+8
* The `io::Seek` trait. * The `Iterator::{partition, unsip}` methods. * The `Vec::into_boxed_slice` method. * The `LinkedList::append` method. * The `{or_insert, or_insert_with` methods in the `Entry` APIs. r? @alexcrichton
2015-03-31rollup merge of #23907: alexcrichton/impl-exitAlex Crichton-0/+25
This commit is an implementation of [RFC #1011][rfc] which adds an `exit` function to the standard library for immediately terminating the current process with a specified exit code. [rfc]: https://github.com/rust-lang/rfcs/pull/1011 Closes #23914
2015-03-31Test fixes and rebase conflicts, round 2Alex Crichton-14/+5
2015-03-31rollup merge of #23873: alexcrichton/remove-deprecatedAlex Crichton-2608/+150
Conflicts: src/libcollectionstest/fmt.rs src/libcollectionstest/lib.rs src/libcollectionstest/str.rs src/libcore/error.rs src/libstd/fs.rs src/libstd/io/cursor.rs src/libstd/os.rs src/libstd/process.rs src/libtest/lib.rs src/test/run-pass-fulldeps/compiler-calls.rs