about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2017-07-07Fix Rustbuild linking on IllumosNikita Baksalyar-0/+4
Illumos (an OpenSolaris fork) expects to get several extra library references for some system functions used by Rust standard library. This commit adds required linker options to rustbuild, which is currently doesn't work on Illumos-based operating systems.
2017-07-06Implement TcpStream::connect_timeoutSteven Fackler-2/+193
This breaks the "single syscall rule", but it's really annoying to hand write and is pretty foundational.
2017-07-06Redox: add stat methods(); support is_symlink()Ian Douglas Scott-2/+17
2017-07-06Add annotations to the resize fn #39791Ryan Thomas-0/+2
This adds the `inline(never)` and `cold` annotations to the HashMap::resize function.
2017-07-06remove associated_consts feature gateSean McArthur-1/+1
2017-07-06Stabilize float_bits_convest31-9/+4
2017-07-06Auto merge of #42899 - alexcrichton:compiler-builtins, r=nikomatsakisbors-1/+1
Switch to rust-lang-nursery/compiler-builtins This commit migrates the in-tree `libcompiler_builtins` to the upstream version at https://github.com/rust-lang-nursery/compiler-builtins. The upstream version has a number of intrinsics written in Rust and serves as an in-progress rewrite of compiler-rt into Rust. Additionally it also contains all the existing intrinsics defined in `libcompiler_builtins` for 128-bit integers. It's been the intention since the beginning to make this transition but previously it just lacked the manpower to get done. As this PR likely shows it wasn't a trivial integration! Some highlight changes are: * The PR rust-lang-nursery/compiler-builtins#166 contains a number of fixes across platforms and also some refactorings to make the intrinsics easier to read. The additional testing added there also fixed a number of integration issues when pulling the repository into this tree. * LTO with the compiler-builtins crate was fixed to link in the entire crate after the LTO process as these intrinsics are excluded from LTO. * Treatment of hidden symbols was updated as previously the `#![compiler_builtins]` crate would mark all symbol *imports* as hidden whereas it was only intended to mark *exports* as hidden.
2017-07-06Auto merge of #42727 - alexcrichton:allocators-new, r=eddybbors-54/+178
rustc: Implement the #[global_allocator] attribute This PR is an implementation of [RFC 1974] which specifies a new method of defining a global allocator for a program. This obsoletes the old `#![allocator]` attribute and also removes support for it. [RFC 1974]: https://github.com/rust-lang/rfcs/pull/1974 The new `#[global_allocator]` attribute solves many issues encountered with the `#![allocator]` attribute such as composition and restrictions on the crate graph itself. The compiler now has much more control over the ABI of the allocator and how it's implemented, allowing much more freedom in terms of how this feature is implemented. cc #27389
2017-07-05Be more specific about the implications of the panic!Stefan Schindler-1/+1
2017-07-05rustc: Implement the #[global_allocator] attributeAlex Crichton-54/+178
This PR is an implementation of [RFC 1974] which specifies a new method of defining a global allocator for a program. This obsoletes the old `#![allocator]` attribute and also removes support for it. [RFC 1974]: https://github.com/rust-lang/rfcs/pull/197 The new `#[global_allocator]` attribute solves many issues encountered with the `#![allocator]` attribute such as composition and restrictions on the crate graph itself. The compiler now has much more control over the ABI of the allocator and how it's implemented, allowing much more freedom in terms of how this feature is implemented. cc #27389
2017-07-05Insert current implementation headerStefan Schindler-0/+2
2017-07-05Switch to rust-lang-nursery/compiler-builtinsAlex Crichton-1/+1
This commit migrates the in-tree `libcompiler_builtins` to the upstream version at https://github.com/rust-lang-nursery/compiler-builtins. The upstream version has a number of intrinsics written in Rust and serves as an in-progress rewrite of compiler-rt into Rust. Additionally it also contains all the existing intrinsics defined in `libcompiler_builtins` for 128-bit integers. It's been the intention since the beginning to make this transition but previously it just lacked the manpower to get done. As this PR likely shows it wasn't a trivial integration! Some highlight changes are: * The PR rust-lang-nursery/compiler-builtins#166 contains a number of fixes across platforms and also some refactorings to make the intrinsics easier to read. The additional testing added there also fixed a number of integration issues when pulling the repository into this tree. * LTO with the compiler-builtins crate was fixed to link in the entire crate after the LTO process as these intrinsics are excluded from LTO. * Treatment of hidden symbols was updated as previously the `#![compiler_builtins]` crate would mark all symbol *imports* as hidden whereas it was only intended to mark *exports* as hidden.
2017-07-04Auto merge of #43051 - Mark-Simulacrum:rollup, r=Mark-Simulacrumbors-18/+27
Rollup of 8 pull requests - Successful merges: #42227, #42836, #42975, #42994, #43041, #43042, #43043, #43045 - Failed merges:
2017-07-04Rollup merge of #42975 - ids1024:symlink2, r=aturonMark Simulacrum-6/+15
redox: symlink and readlink
2017-07-04Rollup merge of #42227 - ollie27:into_to_from, r=aturonMark Simulacrum-12/+12
Convert Intos to Froms. This is a resubmission of #42129 without `impl<T> From<Vec<T>> for Box<[T]>`.
2017-07-04Auto merge of #43025 - est31:nan_cross_platform, r=BurntSushibors-13/+24
Make sNaN removal code tolerate different sNaN encodings IEEE 754-1985 specifies the encoding of NaN floating point numbers, but while it mentions that NaNs can be subdivided into signaling and quiet ones, it doesn't fix the encoding of signaling NaNs in binary formats. This led to different implementations (CPUs) having different encodings. IEEE 754-2008 finally specified the encoding of signaling NaNs but some architectures are compatible with it, while others aren't. Certain MIPS and PA-RISC CPUs have different encodings for signaling NaNs. In order to have the float <-> binary cast feature of the std library be portable to them, we don't mask any quiet NaNs like we did before (only being compliant to IEEE 754-2008 and nothing else), but instead we simply pass a known good NaN instead. Note that in the code removed there was a bug; the 64 bit mask for quiet NaNs should have been `0x0008000000000000` instead of the specified `0x0001000000000000`.
2017-07-03Make sNaN removal code tolerate different sNaN encodingsest31-13/+24
IEEE 754-1985 specifies the encoding of NaN floating point numbers, but while it mentions that NaNs can be subdivided into signaling and quiet ones, it doesn't fix the encoding of signaling NaNs in binary formats. This led to different implementations (CPUs) having different encodings. IEEE 754-2008 finally specified the encoding of signaling NaNs but some architectures are compatible with it, while others aren't. Certain MIPS and PA-RISC CPUs have different encodings for signaling NaNs. In order to have the float <-> binary cast feature of the std library be portable to them, we don't mask any quiet NaNs like we did before (only being compliant to IEEE 754-2008 and nothing else), but instead we simply pass a known good NaN instead. Note that in the code removed there was a bug; the 64 bit mask for quiet NaNs should have been `0x0008000000000000` instead of the specified `0x0001000000000000`.
2017-07-03Auto merge of #42976 - ids1024:redoxfix, r=sfacklerbors-1/+5
Fix Redox build, apparently broken by #42687
2017-07-02Fix the test failure, add comment, and refactor a little bitest31-2/+17
2017-07-02Output line column info when panickingest31-17/+64
2017-07-01Auto merge of #43002 - SergioBenitez:more-io-inner-stable, r=BurntSushibors-15/+5
Stabilize 'more_io_inner_methods' feature. As in the title. Closes #41519.
2017-07-01Auto merge of #42991 - sfackler:unstable-rangeargument, r=alexcrichtonbors-2/+0
Revert "Stabilize RangeArgument" This reverts commit 143206d54d7558c2326212df99efc98110904fdb. From the discussion in #30877 it seems like this is premature.
2017-06-30Stabilize 'more_io_inner_methods' feature.Sergio Benitez-15/+5
2017-06-30Rollup merge of #42925 - tbu-:pr_document_file_open_errors, r=GuillaumeGomezGuillaume Gomez-9/+30
Document possible `io::ErrorKind`s of `fs::open` Try to make clear that this isn't an API guarantee for now, as we likely want to refine these errors in the future, e.g. `ENOSPC` "No space left on device". CC #40322
2017-06-30Fix long lineIan Douglas Scott-1/+2
2017-06-30Revert "Stabilize RangeArgument"Steven Fackler-2/+0
This reverts commit 143206d54d7558c2326212df99efc98110904fdb.
2017-06-29Fix Redox build, apparently broken by #42687Ian Douglas Scott-1/+5
2017-06-29redox: symlink and readlinkIan Douglas Scott-4/+12
2017-06-29Rollup merge of #42955 - matklad:doc-path, r=steveklabnikAriel Ben-Yehuda-6/+7
Document that `/` works as separator on Windows Hi Whenever I see code like `Path::new("./src/bin/main.rs")` or `path.ends_with("foo/bar")`, I wonder if it will work on Windows as I expect. Unfortunately, reading the current docs does not help to answer this question, because all examples are Unix-specific. However, I believe that using `/` is fine, because both Windows itself [and Rust stdlib](https://github.com/rust-lang/rust/blob/47faf1d51952ecd9d4c8a7325332fba34fbe00bd/src/libstd/sys/windows/path.rs#L26) do treat it as a file separator, and because it is [actually used](https://github.com/rust-lang/cargo/blob/abf01e1eddb3145c83f71b469ea7bee37141e5e1/tests/git.rs#L579) in Cargo. So looks like we can just document it? r? @steveklabnik cc @retep998 I don't actually program for windows that much, so I might be totally wrong, and perhaps we should advise to always use (allocating) `.join` method to construct paths of more than one component?
2017-06-29Rollup merge of #42884 - stepancheg:set-env-run-pass, r=alexcrichtonAriel Ben-Yehuda-81/+1
Move global vars changing tests into run-pass Should fix race #42795
2017-06-29Auto merge of #42848 - ids1024:redox-fix, r=sfacklerbors-3/+2
Fix Redox build, broken in ecbb896b9eb2acadefde57be493e4298c1aa04a3
2017-06-28Document that `/` works as separator on WindowsAleksey Kladov-6/+7
2017-06-28Auto merge of #42745 - sfackler:1.19-stabilization, r=alexcrichtonbors-14/+6
1.19 stabilization r? @alexcrichton
2017-06-28Add links to the `ErrorKind` variants in errors of `open`Tobias Bucher-11/+16
2017-06-28Auto merge of #42431 - nagisa:core-float-2, r=alexcrichtonbors-34/+16
Fix NaN handling in is_sign_negative/positive This would be my proposed fix for the #42425 provided we decide it is indeed a problem. Note this would technically be a breaking change to a stable API. We might want to consider deprecating these methods and adding new ones.
2017-06-27Document possible `io::ErrorKind`s of `fs::open`Tobias Bucher-9/+25
Try to make clear that this isn't an API guarantee for now, as we likely want to refine these errors in the future, e.g. `ENOSPC` "No space left on device". CC #40322
2017-06-26Rollup merge of #42905 - casey:casey-utf8-null-doc, r=steveklabnikCorey Farwell-1/+1
Reword OsStr docs to clarify that utf8 may contain nulls The use of the word "but" in the OsStr docs implies (at least to me) that valid UTF-8 does not contain null bytes. Using "which" instead makes it clear that valid UTF-8 may contain null bytes.
2017-06-25Reword OsStr docs to clarify that utf8 may contain nullsCasey Rodarmor-1/+1
2017-06-24Stabilize RangeArgumentSteven Fackler-0/+2
Move it and Bound to core::ops while we're at it. Closes #30877
2017-06-24Stabilize ThreadIdSteven Fackler-8/+2
Closes #21507
2017-06-24Stabilize OsString::shrink_to_fitSteven Fackler-3/+1
Closes #40421
2017-06-24Stabilize Command::envsSteven Fackler-3/+1
Closes #38526
2017-06-24Move global vars changing tests into run-passStepan Koltsov-81/+1
Should fix race #42795
2017-06-24Auto merge of #42854 - razielgn:relaxed-debug-constraints-on-maps-iterators, ↵bors-2/+2
r=sfackler Relaxed Debug constraints on {HashMap,BTreeMap}::{Keys,Values}. I has hit by this yesterday too. 😄 And I've realised that Debug for BTreeMap::{Keys,Values} wasn't formatting just keys and values respectively, but the whole map. 🤔 Fixed #41924 r? @jonhoo
2017-06-24Auto merge of #42687 - alexcrichton:windows-tls, r=sfacklerbors-109/+140
rustc: Enable #[thread_local] for Windows I think LLVM has had support for quite some time now for this, we just never got around to testing it out and binding it. We've had some trouble landing this in the past I believe, but it's time to try again! This commit flags the `#[thread_local]` attribute as being available for Windows targets and adds an implementation of `register_dtor` in the `thread::local` module to ensure we can destroy these keys. The same functionality is implemented in clang via a function called `__tlregdtor` (presumably provided in some Windows runtime somewhere), but this function unfortunately does not take a data pointer (just a thunk) which means we can't easily call it. For now destructors are just run in the same way the Linux fallback is implemented, which is just keeping track via a single OS-based TLS key.
2017-06-23rustc: Enable #[thread_local] for WindowsAlex Crichton-109/+140
I think LLVM has had support for quite some time now for this, we just never got around to testing it out and binding it. We've had some trouble landing this in the past I believe, but it's time to try again! This commit flags the `#[thread_local]` attribute as being available for Windows targets and adds an implementation of `register_dtor` in the `thread::local` module to ensure we can destroy these keys. The same functionality is implemented in clang via a function called `__tlregdtor` (presumably provided in some Windows runtime somewhere), but this function unfortunately does not take a data pointer (just a thunk) which means we can't easily call it. For now destructors are just run in the same way the Linux fallback is implemented, which is just keeping track via a single OS-based TLS key.
2017-06-23Rollup merge of #42822 - ChrisMacNaughton:guard-traits, r=alexcrichtonMark Simulacrum-0/+21
Ensure Guard types impl Display & Debug Fixes #24372
2017-06-23Rollup merge of #42783 - ids1024:redox-env, r=sfacklerMark Simulacrum-1/+1
Redox: Use create() instead of open() when setting env variable See https://github.com/redox-os/kernel/pull/25.
2017-06-23Relax Debug constraints when debugging {HashMap,BTreeMap}::{Keys,Values}.Federico Ravasio-2/+2
Fixed #41924.
2017-06-23Removed as many "```ignore" as possible.kennytm-45/+76
Replaced by adding extra imports, adding hidden code (`# ...`), modifying examples to be runnable (sorry Homura), specifying non-Rust code, and converting to should_panic, no_run, or compile_fail. Remaining "```ignore"s received an explanation why they are being ignored.