about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2018-03-08Rollup merge of #48857 - Songbird0:improve_column_macro_documentation, ↵Manish Goregaokar-1/+1
r=joshtriplett Modify part of `column!` documentation. Just like `line!` documentation, I've replaced: > The returned column is not the invocation of the `column!` macro itself By > The returned column is *not necessarily* the line of the `column!` invocation itself See #46997.
2018-03-08Rollup merge of #48856 - Songbird0:improve_line_macro_documentation, ↵Manish Goregaokar-1/+1
r=joshtriplett Modify part of `line!` documentation. In accordance with #46997, I've replaced: > The returned line is not the invocation of the line! macro itself [...] By > The returned line is *not necessarily* the line of the `line!` invocation itself [...]
2018-03-09Modify part of `column!` documentation.Anthony Defranceschi-1/+1
Just like `line!` documentation, I've replaced: > The returned column is not the invocation of the `column!` macro itself By > The returned column is *not necessarily* the line of the `column!` invocation itself See #46997.
2018-03-09Modify part of `line!` documentation.Anthony Defranceschi-1/+1
In accordance with #46997, I've replaced: > The returned line is not the invocation of the line! macro itself [...] By > The returned line is *not necessarily* the line of the `line!` invocation itself [...]
2018-03-08Rollup merge of #48292 - topecongiro:from_str-for-path-and-pathbuf, ↵Manish Goregaokar-0/+27
r=alexcrichton Implement FromStr for PathBuf Closes #44431.
2018-03-07Make `assert` macro a built-in procedural macroShotaro Yamada-1/+56
2018-03-06Rollup merge of #48618 - scottmcm:elaborate-exitcode, r=alexcrichtonAlex Crichton-31/+107
Better docs and associated SUCCESS/FAILURE for process::ExitCode Follow-up to https://github.com/rust-lang/rust/pull/48497#discussion_r170676525, since that PR was the minimal thing to unblock https://github.com/rust-lang/rust/issues/48453#issuecomment-368155082. r? @nikomatsakis
2018-03-06Merge branch 'master' of https://github.com/rust-lang/rust1011X-61/+57
2018-03-06Rollup merge of #47463 - bluss:fused-iterator, r=alexcrichtonkennytm-19/+18
Stabilize FusedIterator FusedIterator is a marker trait that promises that the implementing iterator continues to return `None` from `.next()` once it has returned `None` once (and/or `.next_back()`, if implemented). The effects of FusedIterator are already widely available through `.fuse()`, but with stable `FusedIterator`, stable Rust users can implement this trait for their iterators when appropriate. Closes #35602
2018-03-06Rollup merge of #48507 - GuillaumeGomez:cstr-note, r=steveklabnikkennytm-0/+2
Add new warning for CStr::from_ptr Fixes #48401.
2018-03-06Rollup merge of #48754 - leodasvacas:while-let-all-the-things, r=rkruppekennytm-14/+9
while let all the things
2018-03-05Remove unnecessary imports1011X-4/+0
2018-03-05Move tests, re-export items from core::ascii1011X-474/+3
2018-03-05while let all the thingsleonardo.yvens-14/+9
2018-03-05Remove a couple of `isize` references from hashmap docsTobias Bucher-29/+29
Also fix a spelling mistake.
2018-03-06Implement FromStr for PathBuftopecongiro-0/+27
2018-03-03Move process::ExitCode internals to sysScott McMurray-24/+72
Now begins the saga of fixing compilation errors on other platforms...
2018-03-04Rollup merge of #48513 - alexcrichton:simd, r=JoshTriplettkennytm-0/+30
std: Add `arch` and `simd` modules This commit imports the `stdsimd` crate into the standard library, creating an `arch` and `simd` module inside of both libcore and libstd. Both of these modules are **unstable** and will continue to be so until RFC 2335 is stabilized. As a brief recap, the modules are organized as so: * `arch` contains all current architectures with intrinsics, for example `std::arch::x86`, `std::arch::x86_64`, `std::arch::arm`, etc. These modules contain all of the intrinsics defined for the platform, like `_mm_set1_epi8`. * In the standard library, the `arch` module also exports a `is_target_feature_detected` macro which performs runtime detection to determine whether a target feature is available at runtime. * The `simd` module contains experimental versions of strongly-typed lane-aware SIMD primitives, to be fully fleshed out in a future RFC. The main purpose of this commit is to start pulling in all these intrinsics and such into the standard library on nightly and allow testing and such. This'll help allow users to easily kick the tires and see if intrinsics work as well as allow us to test out all the infrastructure for moving the intrinsics into the standard library.
2018-03-03core: Update stability attributes for FusedIteratorUlrik Sverdrup-18/+18
2018-03-03core: Stabilize FusedIteratorUlrik Sverdrup-18/+17
FusedIterator is a marker trait that promises that the implementing iterator continues to return `None` from `.next()` once it has returned `None` once (and/or `.next_back()`, if implemented). The effects of FusedIterator are already widely available through `.fuse()`, but with stable `FusedIterator`, stable Rust users can implement this trait for their iterators when appropriate.
2018-03-02Rollup merge of #48328 - frewsxcv:frewsxcv-clarify-error-zero-duration, ↵Manish Goregaokar-14/+134
r=sfackler Fixes #47311. r? @nrc
2018-03-02std: Add `arch` and `simd` modulesAlex Crichton-0/+30
This commit imports the `stdsimd` crate into the standard library, creating an `arch` and `simd` module inside of both libcore and libstd. Both of these modules are **unstable** and will continue to be so until RFC 2335 is stabilized. As a brief recap, the modules are organized as so: * `arch` contains all current architectures with intrinsics, for example `std::arch::x86`, `std::arch::x86_64`, `std::arch::arm`, etc. These modules contain all of the intrinsics defined for the platform, like `_mm_set1_epi8`. * In the standard library, the `arch` module also exports a `is_target_feature_detected` macro which performs runtime detection to determine whether a target feature is available at runtime. * The `simd` module contains experimental versions of strongly-typed lane-aware SIMD primitives, to be fully fleshed out in a future RFC. The main purpose of this commit is to start pulling in all these intrinsics and such into the standard library on nightly and allow testing and such. This'll help allow users to easily kick the tires and see if intrinsics work as well as allow us to test out all the infrastructure for moving the intrinsics into the standard library.
2018-03-02Support posix_spawn() for Linux glibc 2.24+.Bryan Drewery-2/+16
The relevant support was added in https://sourceware.org/bugzilla/show_bug.cgi?id=10354#c12
2018-03-02Move glibc version lookup handling to sys::os and add a simpler glibc_version()Bryan Drewery-28/+37
2018-03-02Use _Bryan Drewery-1/+1
2018-03-01Rollup merge of #48585 - stjepang:stabilize-localkey-try_with, r=alexcrichtonManish Goregaokar-134/+38
Stabilize LocalKey::try_with The `LocalKey::try_with` method is now stabilized. `LocalKey::state` and `LocalKeyState` marked as deprecated. Although, is there any reason to keep them - should we perhaps remove them completely? Closes #27716 r? @alexcrichton
2018-03-01Add comment explaining when posix_spawn() can be supported.Bryan Drewery-0/+2
2018-03-01posix_spawn() on OSX supports returning ENOENT.Bryan Drewery-2/+2
2018-02-28Fix linkcheckerScott McMurray-2/+2
2018-02-28posix_spawn() always returns its error rather than setting errno.Bryan Drewery-1/+1
2018-02-28Support posix_spawn() for FreeBSD.Bryan Drewery-2/+2
spawn() is expected to return an error if the specified file could not be executed. FreeBSD's posix_spawn() supports returning ENOENT/ENOEXEC if the exec() fails, which not all platforms support. This brings a very significant performance improvement for FreeBSD, involving heavy use of Command in threads, due to fork() invoking jemalloc fork handlers and causing lock contention. FreeBSD's posix_spawn() avoids this problem due to using vfork() internally.
2018-02-28Remove excess newlineBryan Drewery-1/+0
2018-02-28Pass proper pointer for envp.Bryan Drewery-1/+1
2018-02-28No need to zero when an initializer for the object is already used.Bryan Drewery-3/+3
2018-02-28Avoid error for unused variablesBryan Drewery-1/+1
2018-02-28Support posix_spawn() when possible.Alex Crichton-0/+102
2018-02-28Rollup merge of #48420 - teiesti:path_parents, r=BurntSushiManish Goregaokar-0/+75
Fixes #47311. r? @nrc
2018-02-28Rollup merge of #48380 - nikomatsakis:issue-48251-master, r=acrichtoManish Goregaokar-2/+4
Fixes #47311. r? @nrc
2018-03-01Fix a bug introduced in previous commitStjepan Glavina-8/+5
2018-02-28Remove thread_local_stateStjepan Glavina-127/+26
2018-02-28Add std::path::Path::ancestorsTobias Stolzmann-0/+75
Squashed commit of the following: commit 1b5d55e26f667b1a25c83c5db0cbb072013a5122 Author: Tobias Stolzmann <tobias.stolzmann@gmail.com> Date: Wed Feb 28 00:06:15 2018 +0100 Bugfix commit 4265c2db0b0aaa66fdeace5d329665fd2d13903a Author: Tobias Stolzmann <tobias.stolzmann@gmail.com> Date: Tue Feb 27 22:59:12 2018 +0100 Rename std::path::Path::parents into std::path::Path::ancestors commit 2548e4b14d377d20adad0f08304a0dd6f8e48e23 Author: Tobias Stolzmann <tobias.stolzmann@gmail.com> Date: Tue Feb 27 12:50:37 2018 +0100 Add tracking issue commit 3e2ce51a6eea0e39af05849f76dd2cefd5035e86 Author: Tobias Stolzmann <tobias.stolzmann@gmail.com> Date: Mon Feb 26 15:05:15 2018 +0100 impl FusedIterator for Parents commit a7e096420809740311e19d963d4aba6df77be2f9 Author: Tobias Stolzmann <tobias.stolzmann@gmail.com> Date: Mon Feb 26 14:38:41 2018 +0100 Clarify that the iterator returned will yield at least one value commit 796a36ea203cd197cc4c810eebd21c7e3433e6f1 Author: Tobias Stolzmann <tobias.stolzmann@gmail.com> Date: Thu Feb 22 14:01:21 2018 +0100 Fix examples commit e279383b21f11c97269cb355a5b2a0ecdb65bb0c Author: Tobias Stolzmann <tobias.stolzmann@gmail.com> Date: Thu Feb 22 04:47:24 2018 +0100 Add std::path::Path::parents
2018-02-28Stabilize LocalKey::try_withStjepan Glavina-15/+23
2018-02-28Rollup merge of #48497 - scottmcm:more-restricted-termination, r=nikomatsakiskennytm-6/+18
Restrict the Termination impls to simplify stabilization Make a minimal commitment in preparation for stabilization. More impls, or broader ones, are likely in future, but are not necessary at this time and are more controversial. cc https://github.com/rust-lang/rust/issues/48453#issuecomment-368155082 r? @nikomatsakis
2018-02-28Auto merge of #48056 - ExpHP:macro-commas, r=dtolnaybors-5/+23
Comprehensively support trailing commas in std/core macros I carefully organized the changes into four commits: * Test cases * Fixes for `macro_rules!` macros * Fixes for builtin macros * Docs for builtins **I can easily scale this back to just the first two commits for now if such is desired.** ### Breaking (?) changes * This fixes #48042, which is a breaking change that I hope people can agree is just a bugfix for an extremely dark corner case. * To fix five of the builtins, this changes `syntax::ext::base::get_single_str_from_tts` to accept a trailing comma, and revises the documentation so that this aspect is not surprising. **I made this change under the (hopefully correct) understanding that `libsyntax` is private rustc implementation detail.** After reviewing all call sites (which were, you guessed it, *precisely those five macros*), I believe the revised semantics are closer to the intended spirit of the function. ### Changes which may require concensus Up until now, it could be argued that some or all the following macros did not conceptually take a comma-separated list, because they only took one argument: * **`cfg(unix,)`** (most notable since cfg! is unique in taking a meta tag) * **`include{,_bytes,_str}("file.rs",)`** (in item form this might be written as "`include!{"file.rs",}`" which is even slightly more odd) * **`compile_error("message",);`** * **`option_env!("PATH",)`** * **`try!(Ok(()),)`** So I think these particular changes may require some sort of consensus. **All of the fixes for builtins are included this list, so if we want to defer these decisions to later then I can scale this PR back to just the first two commits.** ### Other notes/general requests for comment * Do we have a big checklist somewhere of "things to do when adding macros?" My hope is for `run-pass/macro-comma-support.rs` to remain comprehensive. * Originally I wanted the tests to also comprehensively forbid double trailing commas. However, this didn't work out too well: [see this gist and the giant FIXME in it](https://gist.github.com/ExpHP/6fc40e82f3d73267c4e590a9a94966f1#file-compile-fail_macro-comma-support-rs-L33-L50) * I did not touch `select!`. It appears to me to be a complete mess, and its trailing comma mishaps are only the tip of the iceberg. * There are [some compile-fail test cases](https://github.com/ExpHP/rust/blob/5fa97c35da2f0ee/src/test/compile-fail/macro-comma-behavior.rs#L49-L52) that didn't seem to work (rustc emits errors, but compile-fail doesn't acknowledge them), so they are disabled. Any clues? (Possibly related: These happen to be precisely the set of errors which are tagged by rustc as "this error originates in a macro outside of the current crate".) --- Fixes #48042 Closes #46241
2018-02-27Put some thought and documentation effort into process::ExitCodeScott McMurray-24/+52
2018-02-25Rollup merge of #48330 - frewsxcv:frewsxcv-tests-zero-duration, r=sfacklerkennytm-3/+95
Add tests ensuring zero-Duration timeouts result in errors; fix Redox issues. Part of #48311
2018-02-25Return error if timeout is zero-Duration on Redox.Corey Farwell-2/+18
2018-02-25Rollup merge of #48529 - remexre:docs/fix/unicode-0021, r=kennytmkennytm-1/+1
Fixes docs for ASCII functions to no longer claim U+0021 is '@'. Looks like a typo that got copy-pasted without anyone checking on it.
2018-02-25Rollup merge of #48166 - ↵kennytm-2/+1
hedgehog1024:hedgehog1024-stabilize-entry_and_modify, r=alexcrichton Stabilize 'entry_and_modify' feature Stabilize `entry_and_modify` feature introduced by #44734. Closes #44733
2018-02-25Rollup merge of #47970 - vlovich:condvar_wait_until, r=dtolnaykennytm-2/+214
Add Condvar APIs not susceptible to spurious wake Provide wait_until and wait_timeout_until helper wrappers that aren't susceptible to spurious wake. Additionally wait_timeout_until makes it possible to more easily write code that waits for a fixed amount of time in face of spurious wakes since otherwise each user would have to do math on adjusting the duration. Implements #47960.