summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2015-08-10Auto merge of #27531 - bluss:io-copy-dst, r=alexcrichtonbors-2/+14
std: Allow ?Sized parameters in std::io::copy
2015-08-10doc: success is implied reallyTshepang Lekhonkhobe-2/+2
2015-08-10Add Send/Sync traits on Iter struct in hash/tableGuillaume Gomez-1/+25
2015-08-10Auto merge of #27252 - tbu-:pr_less_transmutes, r=alexcrichtonbors-18/+20
The replacements are functions that usually use a single `mem::transmute` in their body and restrict input and output via more concrete types than `T` and `U`. Worth noting are the `transmute` functions for slices and the `from_utf8*` family for mutable slices. Additionally, `mem::transmute` was often used for casting raw pointers, when you can already cast raw pointers just fine with `as`. This builds upon #27233.
2015-08-10Auto merge of #27516 - alexcrichton:osx-flaky-zomg, r=brsonbors-0/+4
The investigation into #14232 discovered that it's possible that signal delivery to a newly spawned process is racy on OSX. This test has been failing spuriously on the OSX bots for some time now, so ignore it as we don't currently know a solution and it looks like it may be out of our control.
2015-08-10std: Allow ?Sized parameters in std::io::copyUlrik Sverdrup-2/+14
std::io::copy did not allow passing trait objects directly (only with an extra &mut wrapping).
2015-08-10Revert "Mark round_up_to_next as inline"Tim Neumann-1/+0
This reverts commit febdc3b201bcce1546c88e3be1b956d3f90d3059.
2015-08-10doc: add missing symbolTshepang Lekhonkhobe-1/+1
2015-08-09Use https URLs to refer to rust-lang.org where appropriate.Eli Friedman-3/+3
Also fixes a few outdated links.
2015-08-09Make `str::as_bytes_mut` privateTobias Bucher-3/+3
2015-08-09Make `slice::transmute*` privateTobias Bucher-2/+1
2015-08-09Replace many uses of `mem::transmute` with more specific functionsTobias Bucher-20/+23
The replacements are functions that usually use a single `mem::transmute` in their body and restrict input and output via more concrete types than `T` and `U`. Worth noting are the `transmute` functions for slices and the `from_utf8*` family for mutable slices. Additionally, `mem::transmute` was often used for casting raw pointers, when you can already cast raw pointers just fine with `as`.
2015-08-09Mark round_up_to_next as inlineAriel Ben-Yehuda-0/+1
This speeds up rustc on #25916 from 1.36Â0.022s to 1.326Â0.025s
2015-08-07Trim trailing newline from FormatMessageWdiaphore-3/+7
2015-08-06Auto merge of #27557 - Manishearth:rollup, r=Manishearthbors-0/+2
- Successful merges: #27546, #27550 - Failed merges:
2015-08-06Rollup merge of #27550 - tshepang:missing-info, r=brsonManish Goregaokar-0/+2
2015-08-06doc: add info about the u64 wrapped in ResultTshepang Lekhonkhobe-0/+2
2015-08-06fs: indicate that we only copy regular filesTshepang Lekhonkhobe-1/+1
2015-08-05Better FFI disciplineTamir Duberstein-5/+3
2015-08-05Auto merge of #27393 - alexcrichton:no-std-changes, r=brsonbors-41/+104
This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The `#![no_std]` attribute now injects `extern crate core` at the top of the crate as well as the libcore prelude into all modules (in the same manner as the standard library's prelude). The `#![no_core]` attribute disables both std and core injection. [rfc]: https://github.com/rust-lang/rfcs/pull/1184 Closes #27394
2015-08-04Auto merge of #26470 - l0kod:process-session-leader, r=alexcrichtonbors-3/+19
Add a new method `CommandExt::session_leader(&mut self, on: bool)` to create a new session (cf. `setsid(2)`) for the child process. This means that the child is the leader of a new process group. The parent process remains the child reaper of the new process. This is not enough to create a daemon process. The *init* process should be the child reaper of a daemon. This can be achieved if the parent process exit. Moreover, a daemon should not have a controlling terminal. To acheive this, a session leader (the child) must spawn another process (the daemon) in the same session. cc rust-lang/rfcs#941 cc #17176
2015-08-04syntax: Don't assume `std` exists for testsAlex Crichton-10/+4
This commit removes the injection of `std::env::args()` from `--test` expanded code, relying on the test runner itself to call this funciton. This is more hygienic because we can't assume that `std` exists at the top layer all the time, and it meaks the injected test module entirely self contained.
2015-08-04std: Ignore test_process_mask on OSXAlex Crichton-0/+4
The investigation into #14232 discovered that it's possible that signal delivery to a newly spawned process is racy on OSX. This test has been failing spuriously on the OSX bots for some time now, so ignore it as we don't currently know a solution and it looks like it may be out of our control.
2015-08-04Rollup merge of #27398 - tshepang:patch-5, r=steveklabnikManish Goregaokar-3/+3
2015-08-03syntax: Implement #![no_core]Alex Crichton-32/+101
This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The `#![no_std]` attribute now injects `extern crate core` at the top of the crate as well as the libcore prelude into all modules (in the same manner as the standard library's prelude). The `#![no_core]` attribute disables both std and core injection. [rfc]: https://github.com/rust-lang/rfcs/pull/1184
2015-08-03Auto merge of #27210 - vadimcn:win64-eh-pers, r=alexcrichtonbors-131/+532
After this change, the only remaining symbol we are pulling from libgcc on Win64 is `__chkstk_ms` - the stack probing routine.
2015-08-02Fix compile errors for ARM.Vadim Chugunov-2/+4
2015-08-03Rollup merge of #27473 - brson:stddocs, r=GankroManish Goregaokar-11/+6
This removes some of the more casual language. The only outright goofiness I couldn't bear to remove is "these modules are the bedrock upon which all of Rust is forged, and they have mighty names like `std::slice` and `std::cmp`", which I believe the greatest sentence I have ever created.
2015-08-02std: Tighten up crate docsBrian Anderson-11/+6
2015-08-02Docs: clarify return value of std::io::Seek::seekSimon Sapin-2/+3
2015-08-01std: Allow to spawn a process as a session leader on UNIXMickaël Salaün-3/+19
2015-07-31trpl: fix link errorFuGangqiang-1/+1
2015-07-31Auto merge of #27370 - alexcrichton:stabilize-easy, r=brsonbors-19/+100
The following APIs were all marked with a `#[stable]` tag: * process::Child::id * error::Error::is * error::Error::downcast * error::Error::downcast_ref * error::Error::downcast_mut * io::Error::get_ref * io::Error::get_mut * io::Error::into_inner * hash::Hash::hash_slice * hash::Hasher::write_{i,u}{8,16,32,64,size}
2015-07-31Auto merge of #26897 - RalfJung:stdin-mut, r=alexcrichtonbors-1/+1
This fixes #26890. To be honest, the local compile-test is still running. This just takes so long. But this looks trivial enough...
2015-07-30Auto merge of #27388 - alexcrichton:remove-curious-inner, r=brsonbors-44/+27
This isn't actually necessary any more with the advent of `$crate` and changes in the compiler to expand macros to `::core::$foo` in the context of a `#![no_std]` crate. The libcore inner module was also trimmed down a bit to the bare bones.
2015-07-30Implement Win64 eh_personality natively.Vadim Chugunov-129/+528
2015-07-30doc: prelude nitsTshepang Lekhonkhobe-3/+3
2015-07-29Auto merge of #27383 - Manishearth:rollup, r=Manishearthbors-23/+19
- Successful merges: #26778, #27232, #27352, #27369, #27373 - Failed merges:
2015-07-29std: Remove the curious inner moduleAlex Crichton-44/+27
This isn't actually necessary any more with the advent of `$crate` and changes in the compiler to expand macros to `::core::$foo` in the context of a `#![no_std]` crate. The libcore inner module was also trimmed down a bit to the bare bones.
2015-07-30Rollup merge of #27373 - alexcrichton:fix-wait-timeout-ms, r=brsonManish Goregaokar-13/+14
The API we're calling requires us to pass an absolute point in time as an argument (`pthread_cond_timedwait`) so we call `gettimeofday` ahead of time to then add the specified duration to. Unfortuantely the current "add the duration" logic forgot to take into account the current time's sub-second precision (e.g. the `tv_usec` field was ignored), causing sub-second duration waits to return spuriously.
2015-07-30Rollup merge of #27369 - brson:realstd, r=alexcrichtonManish Goregaokar-10/+5
Since most lang items are actually defined in core, these hack reexports don't actually do anything useful.
2015-07-29Auto merge of #27368 - alexcrichton:deprecate-net-methods, r=aturonbors-0/+24
These methods are all covered by [RFC 1158] and are currently all available on stable Rust via the [`net2` crate][net2] on crates.io. This commit does not touch the timeout related functions as they're still waiting on `Duration` which is unstable anyway, so punting in favor of the `net2` crate wouldn't buy much. [RFC 1158]: https://github.com/rust-lang/rfcs/pull/1158 [net2]: http://crates.io/crates/net2
2015-07-29std: Fix sub-second Condvar::wait_timeout_msAlex Crichton-13/+14
The API we're calling requires us to pass an absolute point in time as an argument (`pthread_cond_timedwait`) so we call `gettimeofday` ahead of time to then add the specified duration to. Unfortuantely the current "add the duration" logic forgot to take into account the current time's sub-second precision (e.g. the `tv_usec` field was ignored), causing sub-second duration waits to return spuriously.
2015-07-29Rollup merge of #27345 - killercup:patch-15, r=alexcrichtonSteve Klabnik-4/+2
The first paragraph of the docs of the Cursor struct ([src](https://github.com/rust-lang/rust/blob/ff6c6ce917bd6af9c5d9315708ae6be3ba0b7e91/src/libstd/io/cursor.rs#L18-L21)) contains a Markdown link. In listings (like <http://doc.rust-lang.org/nightly/std/io/>), this won't get rendered: ![std__io_-_rust](https://cloud.githubusercontent.com/assets/20063/8925843/5c5281a8-350b-11e5-8c63-09a369d746b0.png) The hotfix would be to change the link by reference: ```rust /// A `Cursor` wraps another type and provides it with a [`Seek`][seek] /// implementation. /// /// [seek]: trait.Seek.html ``` to a direct link: ```rust /// A `Cursor` wraps another type and provides it with a /// [`Seek`](trait.Seek.html) implementation. ``` _I have not tested this as I don't have access to a machine for compiling Rust right now._ (This seems to be a more general issue, but I think I have seen this mentioned before. This PR is just to hotfix on particular occurrence. Rustdoc seems to only read the first paragraph of a doc string for the description in index pages, and _after that_ convert Markdown to HTML.) r? @steveklabnik
2015-07-29Rollup merge of #27342 - steveklabnik:fix_links, r=alexcrichtonSteve Klabnik-2/+2
How embarassing :sob: r? @alexcrichton
2015-07-29Rollup merge of #27341 - steveklabnik:remove_warning, r=alexcrichtonSteve Klabnik-4/+0
This isn't a standard header, and the other docs don't use it, so let's remove it.
2015-07-29Rollup merge of #27327 - steveklabnik:fix_take, r=alexcrichtonSteve Klabnik-1/+1
This only reads five bytes, so don't use a ten byte buffer, that's confusing. r? @alexcrichton
2015-07-29Rollup merge of #27326 - steveklabnik:doc_show_use, r=GankroSteve Klabnik-32/+63
In spirit with https://internals.rust-lang.org/t/should-we-keep-including-obvious-imports-in-code-examples/2217, show the feature flags we're using in examples. (also one instance of 'use')
2015-07-29Auto merge of #27360 - dhuseby:fixing_freebsd_stat_structs_and_tests, ↵bors-67/+124
r=alexcrichton …ebsd 10.1 x86_64 and i686
2015-07-29Auto merge of #27339 - alexcrichton:remove-old-rt, r=brsonbors-44/+3
These aren't really used for anything any more, so there doesn't seem to be much reason to leave them around in the `rt` directory. There was some limiting of threads spawned or tests when run under valgrind, but very little is run under valgrind nowadays so there's also no real use keeping these around.