about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2015-08-11Rollup merge of #27651 - tshepang:patch-8, r=GankroManish Goregaokar-1/+1
2015-08-11Rollup merge of #27648 - tshepang:patch-7, r=brsonManish Goregaokar-2/+2
2015-08-11Rollup merge of #27633 - tshepang:patch-6, r=alexcrichtonManish Goregaokar-1/+1
2015-08-11Rollup merge of #27577 - diaphore:trailing-newline-formatmessagew, ↵Manish Goregaokar-3/+7
r=alexcrichton `FormatMessageW` always inserts trailing `\r\n` to system messages which is a minor annoyance when they're fed to `Debug` but can break formatting with `Display`. ```rust fn main() { use std::env; if let Err(err) = env::set_current_dir("???") { println!("{:#?}\n{}", err, err); } } ``` ```_ Error { repr: Os { code: 2, message: "The system cannot find the file specified.\r\n" } } The system cannot find the file specified. (os error 2) ```
2015-08-11Auto merge of #27549 - tshepang:clarity, r=alexcrichtonbors-1/+1
2015-08-11Auto merge of #26818 - sfackler:duration-stabilization, r=aturonbors-60/+49
This commit stabilizes the `std::time` module and the `Duration` type. `Duration::span` remains unstable, and the `Display` implementation for `Duration` has been removed as it is still being reworked and all trait implementations for stable types are de facto stable. This is a [breaking-change] to those using `Duration`'s `Display` implementation. I'm opening this PR as a platform for discussion - there may be some method renaming to do as part of the stabilization process.
2015-08-10Fix doc testSteven Fackler-1/+0
2015-08-10Add back and deprecate old methods.Steven Fackler-0/+17
2015-08-10Stabilize the Duration APISteven Fackler-59/+32
This commit stabilizes the `std::time` module and the `Duration` type. `Duration::span` remains unstable, and the `Display` implementation for `Duration` has been removed as it is still being reworked and all trait implementations for stable types are de facto stable. This is a [breaking-change] to those using `Duration`'s `Display` implementation.
2015-08-10Auto merge of #27338 - alexcrichton:remove-morestack, r=brsonbors-509/+88
This commit removes all morestack support from the compiler which entails: * Segmented stacks are no longer emitted in codegen. * We no longer build or distribute libmorestack.a * The `stack_exhausted` lang item is no longer required The only current use of the segmented stack support in LLVM is to detect stack overflow. This is no longer really required, however, because we already have guard pages for all threads and registered signal handlers watching for a segfault on those pages (to print out a stack overflow message). Additionally, major platforms (aka Windows) already don't use morestack. This means that Rust is by default less likely to catch stack overflows because if a function takes up more than one page of stack space it won't hit the guard page. This is what the purpose of morestack was (to catch this case), but it's better served with stack probes which have more cross platform support and no runtime support necessary. Until LLVM supports this for all platform it looks like morestack isn't really buying us much. cc #16012 (still need stack probes) Closes #26458 (a drive-by fix to help diagnostics on stack overflow) r? @brson
2015-08-10Remove morestack supportAlex Crichton-509/+88
This commit removes all morestack support from the compiler which entails: * Segmented stacks are no longer emitted in codegen. * We no longer build or distribute libmorestack.a * The `stack_exhausted` lang item is no longer required The only current use of the segmented stack support in LLVM is to detect stack overflow. This is no longer really required, however, because we already have guard pages for all threads and registered signal handlers watching for a segfault on those pages (to print out a stack overflow message). Additionally, major platforms (aka Windows) already don't use morestack. This means that Rust is by default less likely to catch stack overflows because if a function takes up more than one page of stack space it won't hit the guard page. This is what the purpose of morestack was (to catch this case), but it's better served with stack probes which have more cross platform support and no runtime support necessary. Until LLVM supports this for all platform it looks like morestack isn't really buying us much. cc #16012 (still need stack probes) Closes #26458 (a drive-by fix to help diagnostics on stack overflow)
2015-08-11doc: remove an unneeded distinctionTshepang Lekhonkhobe-1/+1
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-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-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.