about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
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.
2018-02-24Restrict the Termination impls to simplify stabilizationScott McMurray-6/+18
Make a minimal commitment for stabilization. More impls are likely in future, but are not necessary at this time.
2018-02-251.25.0 -> 1.26.-Manish Goregaokar-1/+1
2018-02-24Fixes docs for ASCII functions to no longer claim U+0021 is '@'.Nathan Ringo-1/+1
2018-02-24Rollup merge of #48499 - dwijnand:patch-1, r=BurntSushiManish Goregaokar-1/+1
Fix capitalisation in Path#file_name's docs
2018-02-24Rollup merge of #48143 - nikomatsakis:termination_trait_in_tests, r=eddybManish Goregaokar-83/+68
Termination trait in tests Support the `Termination` trait in unit tests (cc https://github.com/rust-lang/rust/issues/43301) Also, a drive-by fix for #47075. This is joint work with @bkchr.
2018-02-24Add new warning for CStr::from_ptrGuillaume Gomez-0/+2
2018-02-24Clarify "It is an error to..." wording for zero-duration behaviors.Corey Farwell-14/+134
Documentation fix side of https://github.com/rust-lang/rust/issues/48311.
2018-02-24Fix capitalisation in Path#file_name's docsDale Wijnand-1/+1
2018-02-23Clarify interfaction between File::set_len and file cursorjethrogb-0/+4
2018-02-22Auto merge of #48343 - Mark-Simulacrum:release-step, r=kennytmbors-1/+0
Update nightly to 1.26.0 and bootstrap from beta.
2018-02-22move Termination trait to std::processNiko Matsakis-86/+68
2018-02-22put the "unit test" logic into libtestNiko Matsakis-16/+12
Also make `std::termination` module public and rename feature. The lib feature needs a different name from the language feature.
2018-02-22support unit tests with return values that implement `Terminaton`Niko Matsakis-0/+7
Extend `Termination` trait with a method to determine what happens with a unit test. This commit incorporates work by Bastian Köcher <git@kchr.de>.
2018-02-21Rollup merge of #48354 - m0ppers:add-read-until-link, r=aidanhsGuillaume Gomez-0/+2
Add missing link for read_line Seems I found a missing link 🔗 https://doc.rust-lang.org/stable/std/io/trait.BufRead.html#errors-2
2018-02-21Rollup merge of #48325 - frewsxcv:frewxcv-ignore, r=steveklabnikGuillaume Gomez-7/+7
Mark doc examples w/ `extern` blocks as `ignore`. Fixes https://github.com/rust-lang/rust/issues/48218.
2018-02-21Rollup merge of #48314 - frewsxcv:frewsxcv-broken-link, r=GuillaumeGomezGuillaume Gomez-1/+1
Fix broken documentation link. None
2018-02-20make `#[unwind]` attribute specify expectations more clearlyNiko Matsakis-2/+4
You can now choose between the following: - `#[unwind(allowed)]` - `#[unwind(aborts)]` Per rust-lang/rust#48251, the default is `#[unwind(allowed)]`, though I think we should change this eventually.
2018-02-20Make signature of Path::strip_prefix un-bizarreMichael Lamparski-8/+10
BREAKING CHANGE: This has the potential to cause regressions in type inference.
2018-02-20Fix doc compile errorVitali Lovich-1/+1
2018-02-20stage0 cfg cleanupMark Simulacrum-1/+0
2018-02-19Add missing linkAndreas Streichardt-0/+2
2018-02-18Add tests ensuring zero-Duration timeouts result in errors.Corey Farwell-1/+77
Part of https://github.com/rust-lang/rust/issues/48311
2018-02-18Mark doc examples w/ `extern` blocks as `ignore`.Corey Farwell-7/+7
Fixes https://github.com/rust-lang/rust/issues/48218.
2018-02-18Rollup merge of #48312 - frewsxcv:frewsxcv-section-headings, r=QuietMisdreavusGuillaume Gomez-9/+9
Unify 'Platform-specific behavior' documentation headings. None
2018-02-18Rollup merge of #48275 - matthiaskrgr:codespell, r=kennytm,varkorGuillaume Gomez-5/+5
fix more typos found by codespell.
2018-02-18Rollup merge of #48273 - alercah:file-warning, r=joshtriplettGuillaume Gomez-0/+15
Add a warning to File about mutability. Fixes #47708.
2018-02-18Auto merge of #47687 - SimonSapin:panic-impl, r=sfacklerbors-198/+26
RFC 2070 part 1: PanicInfo and Location API changes This implements part of https://rust-lang.github.io/rfcs/2070-panic-implementation.html Tracking issue: https://github.com/rust-lang/rust/issues/44489 * Move `std::panic::PanicInfo` and `std::panic::Location` to a new `core::panic` module. The two types and the `std` module were already `#[stable]` and stay that way, the new `core` module is `#[unstable]`. * Add a new `PanicInfo::message(&self) -> Option<&fmt::Arguments>` method, which is `#[unstable]`. * Implement `Display` for `PanicInfo` and `Location`
2018-02-18Auto merge of #47544 - U007D:master, r=nikomatsakisbors-12/+3
Relax termination_trait's error bound As per [this conversation](https://github.com/withoutboats/failure/issues/130#issuecomment-358572413) with @withoutboats and @bkchr
2018-02-17Fix broken documentation link.Corey Farwell-1/+1
2018-02-17Unify 'Platform-specific behavior' documentation headings.Corey Farwell-9/+9
2018-02-17Fix tidy violationVitali Lovich-3/+5
2018-02-17fix more typos found by codespell.Matthias Krüger-5/+5
2018-02-17Auto merge of #48294 - GuillaumeGomez:rollup, r=GuillaumeGomezbors-52/+4
Rollup of 8 pull requests - Successful merges: #48095, #48152, #48234, #48239, #48243, #48260, #48284, #48286 - Failed merges:
2018-02-17Wording fixes from review for File.Alexis Hunt-5/+5
2018-02-17Rollup merge of #48239 - GuillaumeGomez:fix-condvar-example, r=QuietMisdreavusGuillaume Gomez-2/+4
Fix condvar example Fixes #48230. r? @QuietMisdreavus
2018-02-17Rollup merge of #48234 - zombiezen:patch-1, r=steveklabnikGuillaume Gomez-2/+0
Remove "empty buffer" doc in read_until This appears copied from fill_buf, but the above paragraph already indicates that a lack of delimiter at the end is EOF.
2018-02-17Rollup merge of #48152 - antoyo:primitive-docs-relevant, r=QuietMisdreavusGuillaume Gomez-48/+0
Primitive docs relevant This fixes the documentation to show the right types in the examples for many integer methods. I need to check if the result is correct before we merge.
2018-02-17Auto merge of #47956 - retep998:is-nibbles, r=BurntSushibors-21/+44
This is the ideal FileType on Windows. You may not like it, but this is what peak performance looks like. Theoretically this would fix https://github.com/rust-lang/rust/issues/46484 The current iteration of this PR should not cause existing code to break, but instead merely improves handling around reparse points. Specifically... * Reparse points are considered to be symbolic links if they have the name surrogate bit set. Name surrogates are reparse points that effectively act like symbolic links, redirecting you to a different directory/file. By checking for this bit instead of specific tags, we become much more general in our handling of reparse points, including those added by third parties. * If something is a reparse point but does not have the name surrogate bit set, then we ignore the fact that it is a reparse point because it is actually a file or directory directly there, despite having additional handling by drivers due to the reparse point. * For everything which is not a symbolic link (including non-surrogate reparse points) we report whether it is a directory or a file based on the presence of the directory attribute bit. * Notably this still preserves invariant that when `is_symlink` returns `true`, both `is_dir` and `is_file` will return `false`. The potential for breakage was far too high. * Adds an unstable `FileTypeExt` to allow users to determine whether a symbolic link is a directory or a file, since `FileType` by design is incapable of reporting this information.
2018-02-16Fix unit test compilationVitali Lovich-11/+17
Also fix some code snippets in documentation.