about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2017-03-15Removes Default for Box<Path>.Clar Charr-14/+0
2017-03-15Auto merge of #40009 - clarcharr:box_to_buf, r=alexcrichtonbors-21/+104
Leftovers from #39594; From<Box> impls These are a few more impls that follow the same reasoning as those from #39594. What's included: * `From<Box<str>> for String` * `From<Box<[T]>> for Vec<T>` * `From<Box<CStr>> for CString` * `From<Box<OsStr>> for OsString` * `From<Box<Path>> for PathBuf` * `Into<Box<str>> for String` * `Into<Box<[T]>> for Vec<T>` * `Into<Box<CStr>> for CString` * `Into<Box<OsStr>> for OsString` * `Into<Box<Path>> for PathBuf` * `<Box<CStr>>::into_c_string` * `<Box<OsStr>>::into_os_string` * `<Box<Path>>::into_path_buf` * Tracking issue for latter three methods + three from previous PR. Currently, the opposite direction isn't doable with `From` (only `Into`) because of the separation between `liballoc` and `libcollections`. I'm holding off on those for a later PR.
2017-03-14Add doc example for `OsString::into_boxed_os_str`.Corey Farwell-0/+12
2017-03-14Add doc example for `OsString::shrink_to_fit`.Corey Farwell-0/+16
2017-03-14Add doc example for `OsString::reserve_exact`.Corey Farwell-0/+10
2017-03-14Add doc example for `OsString::reserve`.Corey Farwell-0/+10
2017-03-14Add doc example for `OsStr::to_os_string`.Corey Farwell-0/+10
2017-03-13Remove function invokation parens from documentation links.Corey Farwell-164/+164
This was never established as a convention we should follow in the 'More API Documentation Conventions' RFC: https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md
2017-03-13std: remove a workaround for privacy limitations that isn't necessary anymoreSean Gillespie-14/+4
2017-03-12Update usages of 'OSX' (and other old names) to 'macOS'.Corey Farwell-27/+27
As of last year with version 'Sierra', the Mac operating system is now called 'macOS'.
2017-03-11Implement placement-in protocol for `HashMap`Charlie Fan-5/+183
2017-03-10Rollup merge of #40410 - clarcharr:os_string_shrink_to_fit, r=alexcrichtonAlex Crichton-0/+25
OsString::shrink_to_fit. Considering how the other capacity-related methods are there, I found it odd that this one wasn't included. Will create a tracking issue once I get an OK on this.
2017-03-10Rollup merge of #40386 - tbu-:pr_display_frombyteswithnulerror, r=alexcrichtonAlex Crichton-6/+40
Distinguish the ways `CStr::from_bytes_with_nul` can fail
2017-03-10Add From<Box<..>> implementations.Clar Charr-21/+104
2017-03-10OsString::shrink_to_fit.Clar Charr-0/+25
2017-03-10travis: Fuchsia builderPetr Hosek-3/+0
This change introduces a Dockerfile and script which builds a complete Fuchsia toolchain which can be used to build Rust distribution for Fuchsia. We only support cross-compiling at the moment, hence only setting the target.
2017-03-09Removed RustFMT changesJoshua Horwitz-0/+21
2017-03-09Distinguish the ways `CStr::from_bytes_with_nul` can failTobias Bucher-6/+40
2017-03-08Rollup merge of #40283 - oconnor663:args_docs, r=alexcrichtonAriel Ben-Yehuda-0/+8
clarify docs for Args and ArgsOs The args() and args_os() docs include a line about how the first element is usually the program name. Include that line in the struct docs too.
2017-03-08Rollup merge of #40237 - arthurprs:hm-adapt2, r=alexcrichtonAriel Ben-Yehuda-24/+74
Reduce size overhead of adaptative hashmap Exposes a boolean flag in RawTable and use it instead of a bool field in HashMap. Taking a bit from capacity or length would make overflow handling tricky. Fixes: #40042
2017-03-05clarify docs for Args and ArgsOsJack O'Connor-0/+8
The args() and args_os() docs include a line about how the first element is usually the program name. Include that line in the struct docs too.
2017-03-05cleanup: remove the *san Cargo features from stdJorge Aparicio-8/+4
these belong to a previous iteration of the sanitizer implementation
2017-03-04Automate timestamp creation and build skipping for native librariesVadim Petrochenkov-11/+4
Add comments
2017-03-04Build compiler-rt and sanitizers only onceVadim Petrochenkov-20/+12
2017-03-04Add/remove `rerun-if-changed` when necessaryVadim Petrochenkov-2/+0
2017-03-03Reduce size overhead of adaptative hashmaparthurprs-24/+74
Exposes a boolean flag in RawTable and use it instead of a bool field in HashMap. Fixes: #40042
2017-03-03Auto merge of #40189 - SimonSapin:one-width, r=alexcrichtonbors-1/+1
Reduce std_unicode’s public API * Only keep one copy of the `UTF8_CHAR_WIDTH` table 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. * Remove `std_unicode::str::is_utf16`. It was only accessible through the `#[unstable]` crate std_unicode. It has never been used in the compiler or standard library since 47e7a05 added it in 2012 “for OS API interop”. It can be replaced with a one-liner: ```rust fn is_utf16(slice: &[u16]) -> bool { std::char::decode_utf16(s).all(|r| r.is_ok()) } ```
2017-03-02Rollup merge of #40139 - tedsta:fuchsia_std_process_fix, r=alexcrichtonCorey Farwell-27/+31
std::process for fuchsia: updated to latest liblaunchpad Our liblaunchpad changed a bit and so fuchsia's std::process impl needs to change a bit. @raphlinus
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