about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2015-02-17rollup merge of #22319: huonw/send-is-not-staticAlex Crichton-75/+78
Conflicts: src/libstd/sync/task_pool.rs src/libstd/thread.rs src/libtest/lib.rs src/test/bench/shootout-reverse-complement.rs src/test/bench/shootout-spectralnorm.rs
2015-02-17Test fixes and rebase conflictsAlex Crichton-19/+20
2015-02-17rollup merge of #22435: aturon/final-stab-threadAlex Crichton-526/+706
Conflicts: src/test/bench/rt-messaging-ping-pong.rs src/test/bench/rt-parfib.rs src/test/bench/task-perf-spawnalot.rs
2015-02-17rollup merge of #22459: alexcrichton/feature-namesAlex Crichton-2/+2
Conflicts: src/rustbook/main.rs
2015-02-17rollup merge of #22454: alexcrichton/stabilize-into-iteratorAlex Crichton-0/+5
Now that the necessary associated types exist for the `IntoIterator` trait this commit stabilizes the trait as-is as well as all existing implementations.
2015-02-17rollup merge of #22441: msiemens/typo_fixAlex Crichton-1/+1
2015-02-17rollup merge of #22440: semarie/openbsd-connect_errorAlex Crichton-2/+5
The `connect_error` test check if connecting to "0.0.0.0:1" works (it shouldn't). And in case of error, the test expects a `ConnectionRefused` error. Under OpenBSD, trying to connect to "0.0.0.0" isn't a `ConnectionRefused`: it is an `InvalidInput` error. The patch allow the error to be `ConnectionRefused` or `InvalidInput`. Another possibility is to check connecting to "127.0.0.1:1" and expects only `ConnectionRefused` error.
2015-02-18Remove usage of .map(|&foo| foo)Kevin Butler-5/+5
2015-02-18Opt for .cloned() over .map(|x| x.clone()) etc.Kevin Butler-4/+4
2015-02-18Update tests for the Send - 'static change.Huon Wilson-4/+4
2015-02-17Fallout from stabilizationAaron Turon-416/+436
2015-02-17rollup merge of #22208: aturon/expose-more-pathAlex Crichton-123/+126
This commit exposes the `is_sep` function and `MAIN_SEP` constant, as well as Windows path prefixes. The path prefix enum is safely exposed on all platforms, but it only yielded as a component for Windows. Exposing the prefix enum as part of prefix components involved changing the type from `OsStr` to the `Prefix` enum, which is a: [breaking-change]
2015-02-17rollup merge of #22024: alexcrichton/asciiAlex Crichton-71/+128
* Move the type parameter on the `AsciiExt` trait to an associated type named `Owned`. * Move `ascii::escape_default` to using an iterator. This is a breaking change due to the removal of the type parameter on the `AsciiExt` trait as well as the modifications to the `escape_default` function to returning an iterator. Manual implementations of `AsciiExt` (or `AsciiExt` bounds) should be adjusted to remove the type parameter and using the new `escape_default` should be relatively straightforward. [breaking-change]
2015-02-17Revise std::thread semanticsAaron Turon-113/+273
This commit makes several changes to `std::thread` in preparation for final stabilization: * It removes the ability to handle panics from `scoped` children; see #20807 for discussion * It adds a `JoinHandle` structure, now returned from `spawn`, which makes it possible to join on children that do not share data from their parent's stack. The child is automatically detached when the handle is dropped, and the handle cannot be copied due to Posix semantics. * It moves all static methods from `std::thread::Thread` to free functions in `std::thread`. This was done in part because, due to the above changes, there are effectively no direct `Thread` constructors, and the static methods have tended to feel a bit awkward. * Adds an `io::Result` around the `Builder` methods `scoped` and `spawn`, making it possible to handle OS errors when creating threads. The convenience free functions entail an unwrap. * Stabilizes the entire module. Despite the fact that the API is changing somewhat here, this is part of a long period of baking and the changes are addressing all known issues prior to alpha2. If absolutely necessary, further breaking changes can be made prior to beta. Closes #20807 [breaking-change]
2015-02-17std: Rename io/path features with old_ prefixAlex Crichton-2/+2
This commit renames the features for the `std::old_io` and `std::old_path` modules to `old_io` and `old_path` to help facilitate migration to the new APIs. This is a breaking change as crates which mention the old feature names now need to be renamed to use the new feature names. [breaking-change]
2015-02-17std: Stabilize the `ascii` moduleAlex Crichton-71/+128
This commit performs a stabilization pass over the `std::ascii` module taking the following actions: * the module name is now stable * `AsciiExt` is now stable after moving its type parameter to an `Owned` associated type * `AsciiExt::is_ascii` is now stable * `AsciiExt::to_ascii_uppercase` is now stable * `AsciiExt::to_ascii_lowercase` is now stable * `AsciiExt::eq_ignore_ascii_case` is now stable * `AsciiExt::make_ascii_uppercase` is added to possibly replace `OwnedAsciiExt::into_ascii_uppercase` (similarly for lowercase variants). * `escape_default` now returns an iterator and is stable * `EscapeDefault` is now stable Trait implementations are now also marked stable. Primarily it is still unstable to *implement* the `AsciiExt` trait due to it containing some unstable methods. [breaking-change]
2015-02-18Add missing marker to std::thread::JoinGuard.Huon Wilson-1/+3
The lifetime was previously, incorrectly unconstrained.
2015-02-18Update the libraries to reflect Send loosing the 'static bound.Huon Wilson-72/+75
In most places this preserves the current API by adding an explicit `'static` bound. Notably absent are some impls like `unsafe impl<T: Send> Send for Foo<T>` and the `std::thread` module. It is likely that it will be possible to remove these after auditing the code to ensure restricted lifetimes are safe. More progress on #22251.
2015-02-17Auto merge of #21774 - ejjeong:enable-test-for-android, r=alexcrichtonbors-1/+9
- Now "make check-stage2-T-aarch64-linux-android-H-x86_64-unknown-linux-gnu" works (#21773) - Fix & enable debuginfo tests for android (#10381) - Fix & enable more tests for android (both for arm/aarch64) - Enable many already-pass tests on android (both for arm/aarch64)
2015-02-17std: Stabilize the IntoIterator traitAlex Crichton-0/+5
Now that the necessary associated types exist for the `IntoIterator` trait this commit stabilizes the trait as-is as well as all existing implementations.
2015-02-17Auto merge of #22311 - lfairy:consistent-fmt, r=alexcrichtonbors-8/+8
This brings it in line with its namesake in `std::io`. [breaking-change] r? @aturon
2015-02-17fix windowsManish Goregaokar-2/+2
2015-02-17Rollup merge of #22030 - mdinger:f32_examples, r=steveklabnikManish Goregaokar-42/+777
Some examples for `std::num::Float` ~~This is WIP for making examples for `f32`. This probably won't pass `make tidy` and I'm not sure which `f32` needs documentation. https://github.com/rust-lang/rust/issues/22025 shows 2 sets of `f32` which seems split between `core` and `std`. I'm not sure which should be documented but I started doing a couple from `std`. Easy to move if that's where they go...~~ ~~Gotta build it eventually to actually see if the docs actually appear where I think they will or if I'm just disillusioned.~~ cc @steveklabnik
2015-02-17Rollup merge of #22311 - lfairy:consistent-fmt, r=alexcrichtonManish Goregaokar-8/+8
This brings it in line with its namesake in `std::io`. [breaking-change] r? @aturon
2015-02-17Rollup merge of #22404 - semarie:signal_reported_right, r=aturonManish Goregaokar-6/+6
The test \"signal_reported_right\" send a signal `1` to `/bin/sh`, and check the status code to check if the signal is reported right. Under OpenBSD, the signal `1` (`SIGHUP`) is catched by `/bin/sh`, resulting the test failed. Use the uncatchable signal `9` (`SIGKILL`) for test.
2015-02-17Rollup merge of #22433 - sfackler:seek-docs, r=aturonManish Goregaokar-3/+2
r? @aturon
2015-02-17Rollup merge of #22402 - nagisa:spring-cleanup-2, r=nikomatsakisManish Goregaokar-0/+16
This commit mostly replaces some of the uses of os::args with env::args. This, for obvious reasons is based on top of #22400. Do not r+ before that lands.
2015-02-17Fix a small typo in libstd/fs.rsMarkus Siemens-1/+1
2015-02-17openbsd: adapt connect_error testSébastien Marie-2/+5
The connect_error test check if connecting to "0.0.0.0:1" works (it shouldn't). And in case of error, the test expects a ConnectionRefused error. Under OpenBSD, trying to connect to "0.0.0.0" isn't a ConnectionRefused: it is an InvalidInput error. The patch allow the error to be ConnectionRefused or InvalidInput.
2015-02-17Auto merge of #22397 - Manishearth:rollup, r=huonwbors-9/+91
None
2015-02-16Make io::Seek docs less prescriptiveSteven Fackler-3/+2
2015-02-17Auto merge of #21932 - Jormundir:std-os-errno-type, r=alexcrichtonbors-13/+13
Changes std::os::errno to return i32, the return type used by the function being delegated to. This is my first contribution, so feel free to give me advice. I'll be happy to correct things.
2015-02-17Rollup merge of #22411 - aturon:fix-os-deprecation, r=alexcrichtonManish Goregaokar-4/+4
They now point to the correct locations in std::env r? @alexcrichton
2015-02-17Rollup merge of #22313 - japaric:iter, r=aturonManish Goregaokar-0/+80
`IntoIterator` now has an extra associated item: ``` rust trait IntoIterator { type Item; type IntoIter: Iterator<Self=Self::Item>; } ``` This lets you bind the iterator \"`Item`\" directly when writing generic functions: ``` rust // hypothetical change, not included in this PR impl Extend<T> for Vec<T> { // you can now write fn extend<I>(&mut self, it: I) where I: IntoIterator<Item=T> { .. } // instead of fn extend<I: IntoIterator>(&mut self, it: I) where I::IntoIter: Iterator<Item=T> { .. } } ``` The downside is that now you have to write an extra associated type in your `IntoIterator` implementations: ``` diff impl<T> IntoIterator for Vec<T> { + type Item = T; type IntoIter = IntoIter<T>; fn into_iter(self) -> IntoIter<T> { .. } } ``` Because this breaks all downstream implementations of `IntoIterator`, this is a [breaking-change] --- r? @aturon
2015-02-17Rollup merge of #22374 - richo:warn-fixup, r=huonwManish Goregaokar-1/+0
This snuck through my refactor. Would it be worth the effort to have a test pass that attempts to lint the code for all targets, even if it's not feasible to actually build and test it?
2015-02-17Rollup merge of #22363 - semarie:openbsd-test_file_desc, r=alexcrichtonManish Goregaokar-1/+4
`pipe(2)`, under FreeBSD and OpenBSD return a bidirectionnal pipe. So reading from the writer would block (waiting data) instead of returning an error. like for FreeBSD, disable the test for OpenBSD.
2015-02-17Rollup merge of #22353 - tshepang:improve-fs-create-docs, r=alexcrichtonManish Goregaokar-3/+3
2015-02-16Deprecate std::sync::TaskPoolAaron Turon-5/+5
Rather than stabilize on the current API, we're going to punt this concern to crates.io, to allow for faster iteration. If you need this functionality, you might look at https://github.com/carllerche/syncbox [breaking-change]
2015-02-16Expose more of std::pathAaron Turon-123/+126
This commit exposes the `is_sep` function and `MAIN_SEP` constant, as well as Windows path prefixes. The path prefix enum is safely exposed on all platforms, but it only yielded as a component for Windows. Exposing the prefix enum as part of prefix components involved changing the type from `OsStr` to the `Prefix` enum, which is a: [breaking-change]
2015-02-16Update std::os deprecation warningsAaron Turon-4/+4
They now point to the correct locations in std::env
2015-02-16Document std::num::Float with examplesmdinger-42/+777
2015-02-16change the signal used to test signal_reported_rightSébastien Marie-6/+6
The test "signal_reported_right" send a signal `1` to `/bin/sh`, and check the status code to check if the signal is reported right. Under OpenBSD, the signal `1` (`SIGHUP`) is catched by `/bin/sh`, resulting the test failed. Use the uncatchable signal `9` (`SIGKILL`) for test.
2015-02-16Implement ExactSizeIterator for Args and ArgsOsSimonas Kazlauskas-0/+16
Fixes #22343
2015-02-16Auto merge of #22367 - Manishearth:rollup, r=steveklabnikbors-43/+52
(still testing locally)
2015-02-15lint: fixup extraneous #[allow]Richo Healey-1/+0
This snuck through my refactor
2015-02-15Fix rollup (remove slicing_syntax)Manish Goregaokar-1/+0
2015-02-15Rollup merge of #22297 - nagisa:spring-cleanup, r=alexcrichtonManish Goregaokar-8/+8
This PR replaces uses of `os::getenv` with newly introduced `env::var{,_os}`. Mostly did this as a background activity to procrastinate from procrastinating. Tests appear to build and run fine. This includes benchmarks from test/bench directory.
2015-02-15Rollup merge of #22339 - petrochenkov:int, r=huonwManish Goregaokar-23/+23
Some function signatures have changed, so this is a [breaking-change]. In particular, radixes and numerical values of digits are represented by `u32` now. Part of #22240
2015-02-15Rollup merge of #22351 - blaenk:path-hash, r=huonwManish Goregaokar-0/+1
`PathBuf` does implement `Hash`, but `Path` doesn't. This makes it annoying if you have a `HashMap` with `PathBuf`s as keys, because it means you have to convert a `Path` into a `PathBuf` and get a reference to it simply to perform operations on the `HashMap`!
2015-02-15Rollup merge of #22347 - iKevinY:std-lib-panicking, r=brsonManish Goregaokar-6/+6
Rename `libstd/failure.rs` to `libstd/panicking.rs` and `on_fail` to `on_panic`. Closes #22306.