summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2017-03-02Rollup merge of #40081 - GuillaumeGomez:poison-docs, r=frewsxcvGuillaume Gomez-7/+22
Add missing url in sync structs r? @frewsxcv
2017-03-01Only keep one copy of the UTF8_CHAR_WIDTH table.Simon Sapin-1/+1
… instead of one of each of libcore and libstd_unicode. Move the `utf8_char_width` function to `core::str` under the `str_internals` unstable feature.
2017-02-28Rollup merge of #39960 - lukaramu:issue-39925, r=alexcrichtonCorey Farwell-0/+14
added Error and Display impl for std::ffi::FromBytesWithNulError Fixes #39925. This is my first PR, so I wasn't quite sure about the stability annotation.
2017-02-28std::process for fuchsia: updated to latest liblaunchpadTheodore DeRego-27/+31
2017-02-28Rollup merge of #40122 - robinst:process-add-example-for-writing-to-stdin, ↵Corey Farwell-0/+25
r=alexcrichton Example for how to provide stdin using std::process::Command Spawning a child process and writing to its stdin is a bit tricky due to `as_mut` and having to use a limited borrow. An example for this might help newer users. r? @steveklabnik
2017-02-28Rollup merge of #40033 - GuillaumeGomez:condvar-docs, r=frewsxcvCorey Farwell-16/+230
Add missing urls and examples for Condvar docs r? @frewsxcv
2017-02-28Add missing url in sync structsGuillaume Gomez-7/+22
2017-02-27Auto merge of #38165 - Yamakaky:better-backtrace, r=petrochenkovbors-515/+760
Improve backtrace formating while panicking. Fixes #37783. Done: - Fix alignment of file paths for better readability - `RUST_BACKTRACE=full` prints all the informations (current behaviour) - `RUST_BACKTRACE=(short|yes)` is the default and does: - Skip irrelevant frames at the beginning and the end - Remove function address - Remove the current directory from the absolute paths - Remove `::hfabe6541873` at the end of the symbols - `RUST_BACKTRACE=(0|no)` disables the backtrace. - `RUST_BACKTRACE=<everything else>` is equivalent to `short` for backward compatibility. - doc - More uniform printing across platforms. Removed, TODO in a new PR: - Remove path prefix for libraries and libstd Example of short backtrace: ```rust fn fail() { panic!(); } fn main() { let closure = || fail(); closure(); } ``` Short: ``` thread 'main' panicked at 'explicit panic', t.rs:2 Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. stack backtrace: 0: t::fail at ./t.rs:2 1: t::main::{{closure}} at ./t.rs:6 2: t::main at ./t.rs:7 ``` Full: ``` thread 'main' panicked at 'This function never returns!', t.rs:2 stack backtrace: 0: 0x558ddf666478 - std::sys::imp::backtrace::tracing::imp::unwind_backtrace::hec84c9dd8389cc5d at /home/yamakaky/dev/rust/rust/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49 1: 0x558ddf65d90e - std::sys_common::backtrace::_print::hfa25f8b31f4b4353 at /home/yamakaky/dev/rust/rust/src/libstd/sys_common/backtrace.rs:71 2: 0x558ddf65cb5e - std::sys_common::backtrace::print::h9b711e11ac3ba805 at /home/yamakaky/dev/rust/rust/src/libstd/sys_common/backtrace.rs:60 3: 0x558ddf66796e - std::panicking::default_hook::{{closure}}::h736d216e74748044 at /home/yamakaky/dev/rust/rust/src/libstd/panicking.rs:355 4: 0x558ddf66743c - std::panicking::default_hook::h16baff397e46ea10 at /home/yamakaky/dev/rust/rust/src/libstd/panicking.rs:371 5: 0x558ddf6682bc - std::panicking::rust_panic_with_hook::h6d5a9bb4eca42c80 at /home/yamakaky/dev/rust/rust/src/libstd/panicking.rs:559 6: 0x558ddf64ea93 - std::panicking::begin_panic::h17dc549df2f10b99 at /home/yamakaky/dev/rust/rust/src/libstd/panicking.rs:521 7: 0x558ddf64ec42 - t::diverges::he6bc43fc925905f5 at /tmp/p/t.rs:2 8: 0x558ddf64ec5a - t::main::h0ffc20356b8a69c0 at /tmp/p/t.rs:6 9: 0x558ddf6687f5 - core::ops::FnOnce::call_once::hce41f19c0db56f93 10: 0x558ddf667cde - std::panicking::try::do_call::hd4c8c97efb4291df at /home/yamakaky/dev/rust/rust/src/libstd/panicking.rs:464 11: 0x558ddf698d77 - __rust_try 12: 0x558ddf698c57 - __rust_maybe_catch_panic at /home/yamakaky/dev/rust/rust/src/libpanic_unwind/lib.rs:98 13: 0x558ddf667adb - std::panicking::try::h2c56ed2a59ec1d12 at /home/yamakaky/dev/rust/rust/src/libstd/panicking.rs:440 14: 0x558ddf66cc9a - std::panic::catch_unwind::h390834e0251cc9af at /home/yamakaky/dev/rust/rust/src/libstd/panic.rs:361 15: 0x558ddf6809ee - std::rt::lang_start::hb73087428e233982 at /home/yamakaky/dev/rust/rust/src/libstd/rt.rs:57 16: 0x558ddf64ec92 - main 17: 0x7fecb869e290 - __libc_start_main 18: 0x558ddf64e8b9 - _start 19: 0x0 - <unknown> ```
2017-02-27Example for how to provide stdin using std::process::CommandRobin Stocker-0/+25
Spawning a child process and writing to its stdin is a bit tricky due to `as_mut` and having to use a limited borrow. An example for this might help newer users.
2017-02-26Also ignore std::panicYamakaky-0/+3
2017-02-26Remove unusedYamakaky-1/+0
2017-02-26Fix tests on Windows in Debug configuration (#4)Vadim Petrochenkov-0/+6
2017-02-25typoYamakaky-1/+1
2017-02-25Fix tests on ARM Linux (#3)Vadim Petrochenkov-1/+4
2017-02-25Rollup merge of #40024 - raphlinus:readdir, r=alexcrichtonEduard-Mihai Burtescu-14/+15
Switch Fuchsia to readdir (instead of readdir_r) The readdir_r function is deprecated on newer Posix systems because of various problems, and not implemented at all for Fuchsia. There are already implementations using both, and this patch switches Fuchsia over to the readdir-based one. Fixes #40021 for Fuchsia, but that issue also contains discussion of what should happen for other Posix systems.
2017-02-25Rollup merge of #40020 - alexcrichton:fix-unwind-safe, r=sfacklerEduard-Mihai Burtescu-1/+1
std: Relax UnwindSafe impl for Unique Add the `?Sized` bound as we don't require the type to be sized. Closes #40011
2017-02-25Rollup merge of #39988 - arthurprs:hm-adapt2, r=alexcrichtonEduard-Mihai Burtescu-23/+11
Simplify/fix adaptive hashmap Please see https://github.com/rust-lang/rust/pull/38368#issuecomment-280957863 for context. The shift length math is broken. It turns out that checking for the shift length is complicated. Using simulations it's possible to see that a value of 2000 will only get probabilities down to ~1e-7 when the hashmap load factor is 90% (rust goes up to 90.9% as of today). That's probably not good enough to go into the stdlib with pluggable hashers. So this PR simplify the adaptive behavior to only consider displacement, which is much safer and very useful by itself. There's two comments because one of them is already being tested to be merged by bors.
2017-02-25Rollup merge of #39961 - redox-os:redox, r=alexcrichtonEduard-Mihai Burtescu-1/+13
Fix compilation on Redox This updates the Redox sys module to fix compilation. The functions peek and peek_from are added to TcpStream and UdpSocket as stubs. The sys::backtrace module is now included correctly
2017-02-25Rollup merge of #39914 - raphlinus:mx_handle_wait, r=alexcrichtonEduard-Mihai Burtescu-3/+7
Follow rename of mx_handle_wait Magenta syscalls The mx_handle_wait_* syscalls in Magenta were renamed to mx_object_wait. The syscall is used in the Magenta/Fuchsia implementation of std::process, to wait on child processes. In addition, this patch enables the use of the system provided libbacktrace library on Fuchsia targets. Symbolization is not yet working, but at least it allows printing hex addresses in a backtrace and makes building succeed when the backtrace feature is not disabled.
2017-02-24Rollup merge of #40052 - GuillaumeGomez:sunc_docs, r=frewsxcvGuillaume Gomez-1/+3
Add missing urls in MutexGuard docs r? @frewsxcv
2017-02-24Rollup merge of #40030 - matklad:stack-docs, r=alexcrichtonGuillaume Gomez-3/+6
Clarify thread::Builder::stack_size docs Add two pieces of information: * the size is in bytes * the actual stack size might be bigger. Also change the example to use a more realistic value of 32 kilobytes. r? @steveklabnik
2017-02-24Rollup merge of #40010 - GuillaumeGomez:barrier-docs, r=frewsxcvGuillaume Gomez-7/+69
Add missing urls and examples into Barrier structs r? @frewsxcv
2017-02-23rposition() -> rev().position() (#2)Vadim Petrochenkov-1/+1
2017-02-23Fix tests on Windows (#1)Vadim Petrochenkov-40/+56
2017-02-23Add missing urls in MutexGuard docsGuillaume Gomez-1/+3
2017-02-23Add missing urls and examples for Condvar docsGuillaume Gomez-16/+230
2017-02-22Merge branch 'master' of https://github.com/rust-lang/rust into readdirRaph Levien-57/+83
2017-02-22Update name_bytes, scoop up latest libcRaph Levien-3/+3
Update the implementation of name_bytes to use the owned string (which is thread safe). Also bump the src/liblibc submodule now that's merged.
2017-02-22Clarify thread::Builder::stack_sizeAleksey Kladov-3/+6
2017-02-21Switch Fuchsia to readdir (instead of readdir_r)Raph Levien-11/+12
The readdir_r function is deprecated on newer Posix systems because of various problems, and not implemented at all for Fuchsia. There are already implementations using both, and this patch switches Fuchsia over to the readdir-based one. Fixes #40021 for Fuchsia, but that issue also contains discussion of what should happen for other Posix systems.
2017-02-21std: Relax UnwindSafe impl for UniqueAlex Crichton-1/+1
Add the `?Sized` bound as we don't require the type to be sized. Closes #40011
2017-02-21Add missing urls and examples into Barrier structsGuillaume Gomez-7/+69
2017-02-21Get linkchecker cleanSteve Klabnik-3/+3
This affects the book, some missed things in the reference, the grammar, and the standard library. Whew!
2017-02-21Auto merge of #39874 - amosonn:master, r=alexcrichtonbors-10/+49
Fixes overflow in libsdt/io/cursor.rs "seek" Fixes #39631 Test which fails (with old implementation), then fix to implementation.
2017-02-21changed stability annotationslukaramu-2/+2
Changed stability annotations for the new Error and Display impls for std::ffi::FromBytesWithNulError as they aren't subject to stability the same way.
2017-02-20Simplify adaptive hashmaparthurprs-23/+11
2017-02-20Rollup merge of #39976 - steveklabnik:reenable-book-linkchecker, r=frewsxcvCorey Farwell-3/+3
Reenable linkchecker for books In some senses, this is a revert of https://github.com/rust-lang/rust/pull/39633/commits/cacb3bc9c741a7d41a1085af850cd3ff852307f5#diff-b64563d143f859565c8357a28ef81101R212; we disabled linkchecker for the book because the links were added by JavaScript. Now, that's fixed upstream, and so we can re-enable the checker. This also involves two other fixes: we have to check for `name`s as well as `id`s for links, and the linking algorithm of mdBook changed to the same as rustdoc's, so we change some links back. ~~~This isn't quite ready yet; it's [depending on a PR of mine to mdBook](https://github.com/azerupi/mdBook/pull/209). After that's released, this should be the last of these kinds of shenanigans~~~ 😄 This is good to go 😄
2017-02-20Rollup merge of #39937 - arthurprs:hm-adapt, r=frewsxcvCorey Farwell-5/+5
Fix spelling in hashmap comments Fixing my bad english from #38368 Note to self: triple check spelling/grammar
2017-02-20Revert "Fix up links"Steve Klabnik-3/+3
This reverts commit 7f1d1c6d9a7be5e427bace30e740b16b25f25c92. The original commit was created because mdBook and rustdoc had different generation algorithms for header links; now with https://github.com/rust-lang/rust/pull/39966 , the algorithms are the same. So let's undo this change. ... when I came across this problem, I said "eh, this isn't fun, but it doesn't take that long." I probably should have just actually taken the time to fix upstream, given that they were amenable. Oh well!
2017-02-19added Error and Display impl for std::ffi::FromBytesWithNulErrorlukaramu-0/+14
2017-02-19Auto merge of #39871 - binarycrusader:issue-39868, r=alexcrichtonbors-29/+9
libstd needs update for pending libc change This updates libstd to accommodate the fixes made in https://github.com/rust-lang/libc/pull/523 Fixes #39868
2017-02-18Fix spelling in commentsarthurprs-5/+5
2017-02-18Rollup merge of #39928 - GuillaumeGomez:env_func_urls, r=frewsxcvGuillaume Gomez-4/+11
Add missing urls for env functions r? @frewsxcv
2017-02-18Rollup merge of #39862 - stjepang:fix-wording-localkey, r=GuillaumeGomezGuillaume Gomez-3/+3
Fix wording in LocalKey documentation Fixes #39841 r? @GuillaumeGomez
2017-02-18Add missing urls for env functionsGuillaume Gomez-4/+11
2017-02-17Follow rename of mx_handle_wait Magenta syscallsRaph Levien-3/+7
The mx_handle_wait_* syscalls in Magenta were renamed to mx_object_wait. The syscall is used in the Magenta/Fuchsia implementation of std::process, to wait on child processes. In addition, this patch enables the use of the system provided libbacktrace library on Fuchsia targets. Symbolization is not yet working, but at least it allows printing hex addresses in a backtrace and makes building succeed when the backtrace feature is not disabled.
2017-02-16Resize hashmap when long probes are detectedarthurprs-12/+105
2017-02-15simplify home_dir by removing unnecessary getpwuid_r wrapperShawn Walker-Salas-18/+9
2017-02-15Rollup merge of #39861 - retep998:small-fix, r=alexcrichtonCorey Farwell-1/+1
Fix parameter to GetUserProfileDirectoryW
2017-02-15Rollup merge of #39844 - king6cong:sys, r=alexcrichtonCorey Farwell-6/+6
sys/mod doc update and mod import order adjust * Some doc updates. * Racer currently use the first mod it finds regardless of cfg attrs. Moving #[cfg(unix)] up should be a temporary tweak that works as expected for more people.