about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2016-09-30Rollup merge of #36841 - GuillaumeGomez:process_doc, r=steveklabnikSteve Klabnik-1/+19
Improve process module doc a bit r? @steveklabnik
2016-09-30Rollup merge of #36833 - tmiasko:system-time-error, r=steveklabnikSteve Klabnik-1/+1
Reword description of SystemTimeError. Repalce timestamp with a system time, to be more consistent with remaining documentation. r? @steveklabnik
2016-09-30Rollup merge of #36535 - GuillaumeGomez:macro_url, r=steveklabnikSteve Klabnik-1/+1
Update to new macro url syntax r? @steveklabnik
2016-09-30Fix BufRead::{read_until, read_line} documentation.Tomasz Miąsko-7/+3
2016-09-29Auto merge of #36557 - sfackler:fix-hashdos-docs, r=alexcrichtonbors-8/+22
Clean up hasher discussion on HashMap * We never want to make guarantees about protecting against attacks. * "True randomness" is not the right terminology to be using in this context. * There is significantly more nuance to the performance of SipHash than "somewhat slow". r? @steveklabnik Follow up to discussion on #35371
2016-09-30add println!() macro with out any arguments石博文-0/+2
2016-09-30Improve process module doc a bitGuillaume Gomez-1/+19
2016-09-29Mention FNVSteven Fackler-1/+1
2016-09-29Auto merge of #36377 - tormol:encode_utf, r=alexcrichtonbors-9/+12
Change encode_utf{8,16}() to write to a buffer and panic if it's too small cc #27784 Should the "A buffer that's too small" examples be removed and replaced by tests?
2016-09-29Reword description of SystemTimeError.Tomasz Miąsko-1/+1
Repalce timestamp with a system time, to be more consistent with remaining documentation.
2016-09-29Clarify HashMap's capacity handling.Nicholas Nethercote-90/+121
This commit does the following. - Changes the terminology for capacities used within HashMap's code. "Internal capacity" is now consistently "raw capacity", and "usable capacity" is now consistently just "capacity". This makes the code easier to understand. - Reworks capacity and raw capacity computations. Raw capacity computations are now handled in a single place: `DefaultResizePolicy::raw_capacity()`. This function correctly returns zero when given zero, which means that the following cases now result in a capacity of zero when they previously did not. * `Hash{Map,Set}::with_capacity(0)` * `Hash{Map,Set}::with_capacity_and_hasher(0)` * `Hash{Map,Set}::shrink_to_fit()`, when used with a hash map/set whose elements have all been removed - Strengthens the language used in the comments describing the above functions, to make it clearer when they will result in a map/set with a capacity of zero. The new language is based on the language used for the corresponding functions in `Vec`. - Adds tests for the above zero-capacity cases. - Removes `test_resize_policy` because it is no longer useful.
2016-09-28Rollup merge of #36811 - brson:bootstrap, r=alexcrichtonJonathan Turner-2/+0
Update bootstrap compiler
2016-09-28Rollup merge of #36741 - matklad:no-flacky-test, r=alexcrichtonJonathan Turner-1/+3
Remove CString drop test. The test relies on the undefined behavior, and so may fail in some circumstances. This can be worked around by stubbing a memory allocator in the test, but it is a bit of work, and LLVM could still theoretically eliminate the write of the zero byte in release mode (which is intended). So let's just remove the test and mark the function as inline. It shouldn't be optimized away when inlined into the debug build of user's code. Supersedes #36607 r? @alexcrichton
2016-09-28Remove stage0 hacksBrian Anderson-2/+0
2016-09-28use MSG_NOSIGNAL from liblibcMathieu Poumeyrol-10/+6
2016-09-28MSG_NOSIGNAL on linuxMathieu Poumeyrol-4/+18
2016-09-28set SO_NOSIGPIPE on apple platformsMathieu Poumeyrol-1/+13
2016-09-28Rollup merge of #36740 - frehberg:apidoc, r=steveklabnikJonathan Turner-0/+30
Document init of HashSet/HashMap from vector
2016-09-28[breaking-change] std: change `encode_utf{8,16}()` to take a buffer and ↵tormol-9/+12
return a slice They panic if the buffer is too small.
2016-09-27[std::io::Chain] Mark first as done only when reading into non-zero length ↵Tomasz Miąsko-1/+12
buffer. Fixes #36771.
2016-09-27Update set.rsFrank Rehberger-0/+2
2016-09-27Update map.rsFrank Rehberger-4/+6
2016-09-26Rollup merge of #36754 - tmiasko:getaddrinfo-errors, r=alexcrichtonJonathan Turner-2/+7
When getaddrinfo returns EAI_SYSTEM retrieve actual error from errno. Fixes issue #36546. This change also updates libc to earliest version that includes EAI_SYSTEM constant. Previously, in cases where `EAI_SYSTEM` has been returned from getaddrinfo, the resulting `io::Error` would be broadly described as "System error": Error { repr: Custom(Custom { kind: Other, error: StringError("failed to lookup address information: System error") }) } After change a more detailed error is crated based on particular value of errno, for example: Error { repr: Os { code: 64, message: "Machine is not on the network" } } The only downside is that the prefix "failed to lookup address information" is no longer included in the error message.
2016-09-26Rollup merge of #36727 - kallisti5:master, r=AatchJonathan Turner-15/+322
Haiku: Initial work at OS support These changes should be non-invasive to non-Haiku platforms. These patches were hand reworked from Neil's original Rust 1.9.0 patches. I've done some style cleanup and design updates along the way. There are a few small additional patches to libc, rust-installer and compiler-rt that will be submitted once this one is accepted. Haiku can be compiled on Linux, and a full gcc cross-compiler with a Haiku target is available, which means bootstrapping should be fairly easy. The patches here have already successfully bootstrapped under our haiku x86_gcc2 architecture. http://rust-on-haiku.com/wiki/PortingRust I'll be focusing on our more modern gcc5 x86 and x86 architectures for now. As for support, we're not seeking official support for now. We understand Haiku isn't a top-tier OS choice, however having these patches upstream greatly reduces the amount of patchwork we have to do. Mesa has Haiku code upstream, and we submit patches to keep it going. Mesa doesn't test on Haiku and we're ok with that :-)
2016-09-26When getaddrinfo returns EAI_SYSTEM retrieve actual error from errno.Tomasz Miąsko-2/+7
Fixes issue #36546. This change also updates libc to earliest version that includes EAI_SYSTEM constant.
2016-09-27run rustfmt on libstd/collections/hash folderSrinivas Reddy Thatiparthy-279/+438
2016-09-26Auto merge of #36719 - shepmaster:build-env-var-reporting, r=alexcrichtonbors-3/+3
Report which required build-time environment variable is not set
2016-09-26Remove CString drop test.Aleksey Kladov-1/+3
The test relies on the undefined behavior, and so may fail in some circumstances. This can be worked around by stubbing a memory allocator in the test, but it is a bit of work, and LLVM could still theoretically eliminate the write of the zero byte in release mode (which is intended). So let's just remove the test and mark the function as inline. It shouldn't be optimized away when inlined into the debug build of user's code.
2016-09-26Update set.rsFrank Rehberger-1/+1
2016-09-26Update map.rsFrank Rehberger-1/+1
2016-09-26Update set.rsFrank Rehberger-4/+2
2016-09-26Update map.rsFrank Rehberger-5/+2
2016-09-26Document init of HashSet/HashMap from vectorFrank Rehberger-0/+31
2016-09-26Auto merge of #36734 - nnethercote:fix-HashSet-sizing, r=Aatchbors-8/+34
Don't allocate during default HashSet creation. The following `HashMap` creation functions don't allocate heap storage for elements. ``` HashMap::new() HashMap::default() HashMap::with_hasher() ``` This is good, because it's surprisingly common to create a HashMap and never use it. So that case should be cheap. However, `HashSet` does not have the same behaviour. The corresponding creation functions *do* allocate heap storage for the default number of non-zero elements (which is 32 slots for 29 elements). ``` HashMap::new() HashMap::default() HashMap::with_hasher() ``` This commit gives `HashSet` the same behaviour as `HashMap`, by simply calling the corresponding `HashMap` functions (something `HashSet` already does for `with_capacity` and `with_capacity_and_hasher`). It also reformats one existing `HashSet` construction to use a consistent single-line format. This speeds up rustc itself by 1.01--1.04x on most of the non-tiny rustc-benchmarks.
2016-09-26Haiku: Use common thread set_name stubAlexander von Gluck IV-7/+5
2016-09-26Don't allocate during default HashSet creation.Nicholas Nethercote-8/+34
The following `HashMap` creation functions don't allocate heap storage for elements. ``` HashMap::new() HashMap::default() HashMap::with_hasher() ``` This is good, because it's surprisingly common to create a HashMap and never use it. So that case should be cheap. However, `HashSet` does not have the same behaviour. The corresponding creation functions *do* allocate heap storage for the default number of non-zero elements (which is 32 slots for 29 elements). ``` HashMap::new() HashMap::default() HashMap::with_hasher() ``` This commit gives `HashSet` the same behaviour as `HashMap`, by simply calling the corresponding `HashMap` functions (something `HashSet` already does for `with_capacity` and `with_capacity_and_hasher`). It also reformats one existing `HashSet` construction to use a consistent single-line format. This speeds up rustc itself by 1.01--1.04x on most of the non-tiny rustc-benchmarks.
2016-09-25Report which required build-time environment variable is not setJake Goulding-3/+3
2016-09-25Haiku: Fix pthread_t typesize set to stable 1.8.0 post #29791Alexander von Gluck IV-1/+1
2016-09-25Haiku: Work around the lack of the FIOCLEX ioctlNiels Sascha Reedijk-2/+8
* Hand rebased from Niels original work on 1.9.0
2016-09-25Add support for the Haiku operating system on x86 and x86_64 machinesNiels Sascha Reedijk-11/+314
* Hand rebased from Niels original work on 1.9.0
2016-09-24Rollup merge of #36578 - GuillaumeGomez:fix_typo, r=steveklabnikGuillaume Gomez-2/+2
Replace 'e.g.' by 'i.e.' Fixes #36577. r? @steveklabnik
2016-09-24Rollup merge of #36018 - durka:patch-28, r=steveklabnikGuillaume Gomez-2/+7
strengthen doc warning about CString::from_raw Saw unsound code using this function on IRC.
2016-09-22Auto merge of #36631 - frewsxcv:dir-entry-debug, r=sfacklerbors-0/+20
Implement Debug for DirEntry. None
2016-09-22Rollup merge of #36632 - CryZe:patch-3, r=sfacklerJonathan Turner-2/+2
Fix outdated Doc Comment on BufReader::seek A long time ago non-panicking `unwrap` methods were renamed to `into_inner` in this Pull Request: https://github.com/rust-lang/rust/pull/19149 Looks like this doc comment was not updated however.
2016-09-22Rollup merge of #36423 - GuillaumeGomez:eq_impl, r=pnkfelixJonathan Turner-6/+6
Add missing Eq implementations Part of #36301.
2016-09-22Implement Debug for DirEntry.Corey Farwell-0/+20
2016-09-21Fix outdated Doc Comment on BufReader::seekChristopher Serr-2/+2
A long time ago non-panicking `unwrap` methods were renamed to `into_inner` in this Pull Request: https://github.com/rust-lang/rust/pull/19149 Looks like this doc comment was not updated however.
2016-09-21add assert_ne and debug_assert_ne macrosAshley Williams-2/+2
2016-09-19Replace 'e.g.' by 'i.e.'Guillaume Gomez-2/+2
2016-09-18Auto merge of #36523 - Mark-Simulacrum:format-args-link, r=GuillaumeGomezbors-4/+10
Add links between format_args! macro and std::fmt::Arguments struct r? @GuillaumeGomez