summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2017-02-25std: 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-01-28Auto merge of #39234 - segevfiner:fix-backtraces-on-windows-gnu, r=petrochenkovbors-1/+180
Make backtraces work on Windows GNU targets again. This is done by adding a function that can return a filename to pass to backtrace_create_state. The filename is obtained in a safe way by first getting the filename, locking the file so it can't be moved, and then getting the filename again and making sure it's the same. See: https://github.com/rust-lang/rust/pull/37359#issuecomment-260123399 Issue: #33985 Note though that this isn't that pretty... I had to implement a `WideCharToMultiByte` wrapper function to convert to the ANSI code page. This will work better than only allowing ASCII provided that the ANSI code page is set to the user's local language, which is often the case. Also, please make sure that I didn't break the Unix build.
2017-01-27Rollup merge of #39344 - ollie27:links, r=steveklabnikAlex Crichton-3/+3
Fix a few links in the docs r? @steveklabnik
2017-01-27Rollup merge of #39307 - alexcrichton:stabilize-1.16, r=brsonAlex Crichton-29/+12
std: Stabilize APIs for the 1.16.0 release This commit applies the stabilization/deprecations of the 1.16.0 release, as tracked by the rust-lang/rust issue tracker and the final-comment-period tag. The following APIs were stabilized: * `VecDeque::truncate` * `VecDeque::resize` * `String::insert_str` * `Duration::checked_{add,sub,div,mul}` * `str::replacen` * `SocketAddr::is_ipv{4,6}` * `IpAddr::is_ipv{4,6}` * `str::repeat` * `Vec::dedup_by` * `Vec::dedup_by_key` * `Result::unwrap_or_default` * `<*const T>::wrapping_offset` * `<*mut T>::wrapping_offset` * `CommandExt::creation_flags` (on Windows) * `File::set_permissions` * `String::split_off` The following APIs were deprecated * `EnumSet` - replaced with other ecosystem abstractions, long since unstable Closes #27788 Closes #35553 Closes #35774 Closes #36436 Closes #36949 Closes #37079 Closes #37087 Closes #37516 Closes #37827 Closes #37916 Closes #37966 Closes #38080
2017-01-28Use libc::c_char instead of i8 due to platforms with unsigned charSegev Finer-2/+4
2017-01-27Fix a few links in the docsOliver Middleton-3/+3
2017-01-27Attempt at fixing dead code lintsSegev Finer-68/+106
2017-01-26std: Compile libbacktrace with -fvisibility=hiddenAlex Crichton-2/+3
We don't want these symbols exported from the standard library, this is just an internal implementation detail of the standard library currently. Closes #34984
2017-01-25std: Stabilize APIs for the 1.16.0 releaseAlex Crichton-29/+12
This commit applies the stabilization/deprecations of the 1.16.0 release, as tracked by the rust-lang/rust issue tracker and the final-comment-period tag. The following APIs were stabilized: * `VecDeque::truncate` * `VecDeque::resize` * `String::insert_str` * `Duration::checked_{add,sub,div,mul}` * `str::replacen` * `SocketAddr::is_ipv{4,6}` * `IpAddr::is_ipv{4,6}` * `str::repeat` * `Vec::dedup_by` * `Vec::dedup_by_key` * `Result::unwrap_or_default` * `<*const T>::wrapping_offset` * `<*mut T>::wrapping_offset` * `CommandExt::creation_flags` (on Windows) * `File::set_permissions` * `String::split_off` The following APIs were deprecated * `EnumSet` - replaced with other ecosystem abstractions, long since unstable Closes #27788 Closes #35553 Closes #35774 Closes #36436 Closes #36949 Closes #37079 Closes #37087 Closes #37516 Closes #37827 Closes #37916 Closes #37966 Closes #38080
2017-01-25Auto merge of #38856 - zackw:process-envs, r=aturonbors-1/+36
Add std::process::Command::envs() `Command::envs()` adds a vector of key-value pairs to the child process environment all at once. Suggested in #38526. This is not fully baked and frankly I'm not sure it even _works_, but I need some help finishing it up, and this is the simplest way to show you what I've got. The problems I know exist and don't know how to solve, from most to least important, are: * [ ] I don't know if the type signature of the new function is correct. * [x] The new test might not be getting run. I didn't see it go by in the output of `x.py test src/libstd --stage 1`. * [x] The tidy check says ``process.rs:402: different `since` than before`` which I don't know what it means. r? @brson
2017-01-25Rollup merge of #39276 - GuillaumeGomez:array_urls, r=frewsxcvGuillaume Gomez-21/+22
Add missing urls for array docs r? @frewsxcv
2017-01-25Rollup merge of #39212 - redox-os:master, r=brsonGuillaume Gomez-1/+8
Use libc errno in Redox submodule This fixes https://github.com/redox-os/redox/issues/830, and is necessary when using libc in Redox
2017-01-24Updated Fuchsia support for std::process. Adds support for try_wait. Misc. ↵Theodore DeRego-23/+167
updates to reflect changes in Magenta
2017-01-24Make backtraces work on Windows GNU targets again.Segev Finer-1/+140
This is done by adding a function that can return a filename to pass to backtrace_create_state. The filename is obtained in a safe way by first getting the filename, locking the file so it can't be moved, and then getting the filename again and making sure it's the same. See: https://github.com/rust-lang/rust/pull/37359#issuecomment-260123399 Issue: #33985
2017-01-24Add missing urls for array docsGuillaume Gomez-21/+22
2017-01-24Auto merge of #39048 - lambda:impl-tosocketaddrs-for-string, r=alexcrichtonbors-0/+20
impl ToSocketAddrs for String `ToSocketAddrs` is implemented for a number of different types, including `(IpAddr, u16)`, `&str`, and various others, for the convenience of being able to run things like `TcpListener::bind("10.11.12.13:1415")`. However, because this is a generic parameter with a trait bound, if you have a `String` you cannot pass it in, either directly as `TcpListener::bind(string)`, or the `TcpListener::bind(&string)` as you might expect due to deref coercion; you have to use `TcpListener::bind(&*string)`, which is noisy and hard to discover (though #39029 suggests better error messages to make it more discoverable). Rather than making people stumble over this, just implement `ToSocketAddrs` for `String`.
2017-01-23Rollup merge of #39233 - frewsxcv:upper-lower-docs, r=GuillaumeGomezSteve Klabnik-2/+30
Add more references between lowercase/uppercase operations. None
2017-01-22Auto merge of #38648 - ↵bors-163/+163
utkarshkukreti:question-mark-in-libstd-documentation-examples, r=pnkfelix,steveklabnik,frewsxcvx libstd: replace all `try!` with `?` in documentation examples See #38644. For the record, I used the following Perl one-liner and then manually fixed a couple of things it got wrong: $ perl -p -i -e 's#(///.*)try!\((.*)\)#$1$2?#' src/libstd/**/*.rs
2017-01-22libstd: mention `?` operator instead of removing `try!` macro referenceUtkarsh Kukreti-1/+3
2017-01-22libstd: update std::io module documentation to not mention `try!`Utkarsh Kukreti-3/+1
We're not using it in the examples anymore.
2017-01-22libstd: replace all `try!` with `?` in documentation examplesUtkarsh Kukreti-161/+161
See #38644.
2017-01-22Add more references between lowercase/uppercase operations.Corey Farwell-2/+30
2017-01-22Add missing urls for OsStr and OsStringGuillaume Gomez-9/+28
2017-01-22Auto merge of #39221 - frewsxcv:os-string-docs, r=GuillaumeGomezbors-0/+73
Add doc examples for `std::ffi::OsString` fucntions/methods. None
2017-01-22Auto merge of #39176 - CartesianDaemon:master, r=frewsxcvbors-1/+12
Use fs::symlink_metadata in doc for is_symlink fs::metadata() follows symlinks so is_symlink() will always return false. Use symlink_metadata instead in the example in the documentation. See issue #39088.
2017-01-21Revert "Add link to symlink_metadata in fs::Metadata doc"Jack Vickeridge-4/+3
This reverts commit fe9f5d52a6830991609c07455b0267852d9c3545.
2017-01-21Auto merge of #39210 - GuillaumeGomez:GuillaumeGomez-patch-1, r=frewsxcvbors-1/+9
Specify the result of integer cast on boolean Fixes #39190. r? @frewsxcv
2017-01-21Auto merge of #39203 - ranma42:doc_metadata, r=BurntSushibors-3/+5
Document that `Metadata` can be obtained from `symlink_metadata` When retrieving the information about a syslink (specifically, when invoking `Metadata::is_symlink`) you generally want the `syslink_metadata`. It would be natural to point at both options to retrieve a `Metadata` value, as they are both appropriate (for different use cases).
2017-01-21Generalize envs() and args() to iterators.Zack Weinberg-6/+9
* Command::envs() now takes anything that is IntoIterator<Item=(K, V)> where both K and V are AsRef<OsStr>. * Since we're not 100% sure that's the right signature, envs() is now marked unstable. (You can use envs() with HashMap<str, str> but not Vec<(str, str)>, for instance.) * Update the test to match. * By analogy, args() now takes any IntoIterator<Item=S>, S: AsRef<OsStr>. This should be uncontroversial.
2017-01-21Add doc examples for `std::ffi::OsString` fucntions/methods.Corey Farwell-0/+73
2017-01-21Specify the result of integer cast on booleanGuillaume Gomez-1/+9
2017-01-21Auto merge of #39086 - aidanhs:aphs-local-rebuild-no-jemalloc, r=alexcrichtonbors-4/+6
Make rustbuild force_alloc_system rather than relying on stage0 This 'fixes' jemalloc-less local rebuilds, where we tell cargo that we're actually stage1 (this only fixes the rustbuild path, since I wasn't enthusiastic to dive into the makefiles). There should be one effect from this PR: `--enable-local-rebuild --disable-jemalloc` will successfully build a stage0 std (rather than erroring). Ideally I think it'd be nice to specify an allocator preference in Cargo.toml/cargo command line (used when an allocator must be picked i.e. dylibs, not rlibs), but since that's not possible we can make do with a force_alloc_system feature. Sadly this locks you into a single allocator in the build libstd, making any eventual implementation of #38575 not quite right in this edge case, but clearly not many people exercise the combination of these two flags. This PR is also a substitute for #37975 I think. The crucial difference is that the feature name here is distinct from the jemalloc feature (reused in the previous PR) - we don't want someone to be forced into alloc_system just for disabling jemalloc! Fixes #39054 r? @alexcrichton
2017-01-20Use libc errnoJeremy Soller-1/+8
2017-01-20Rollup merge of #39120 - alexcrichton:emscripten-tests, r=brsonAlex Crichton-1/+2
travis: Get an emscripten builder online This commit adds a new entry to the Travis matrix which will execute emscripten test suites. Along the way it updates a few bits of the test suite to continue passing on emscripten, such as: * Ignoring i128/u128 tests as they're presumably just not working (didn't investigate as to why) * Disabling a few process tests (not working on emscripten) * Ignore some num tests in libstd (#39119) * Fix some warnings when compiling
2017-01-20Rollup merge of #38761 - frewsxcv:thread-sleep-formatting, r=alexcrichtonAlex Crichton-3/+6
Add 'platform-specific' section to `sleep_ms` to match `sleep`. None
2017-01-20Document that `Metadata` can be obtained from `symlink_metadata`Andrea Canciani-3/+5
2017-01-20Add link to symlink_metadata in fs::Metadata docJack Vickeridge-3/+4
2017-01-20Fix formatting and links in previous doc change.Jack Vickeridge-4/+10
2017-01-19travis: Get an emscripten builder onlineAlex Crichton-1/+2
This commit adds a new entry to the Travis matrix which will execute emscripten test suites. Along the way it updates a few bits of the test suite to continue passing on emscripten, such as: * Ignoring i128/u128 tests as they're presumably just not working (didn't investigate as to why) * Disabling a few process tests (not working on emscripten) * Ignore some num tests in libstd (#39119) * Fix some warnings when compiling
2017-01-19Rollup merge of #38922 - chris-morgan:fs-markdown-link-fix, r=steveklabnikGuillaume Gomez-1/+2
Fix a couple of bad Markdown links
2017-01-19Rollup merge of #38457 - frewsxcv:include, r=GuillaumeGomezGuillaume Gomez-5/+20
Improvements to 'include' macro documentation. None
2017-01-19Use fs::symlink_metadata in doc for is_symlinkJack Vickeridge-1/+6
fs::metadata() follows symlinks so is_symlink() will always return false. Use symlink_metadata instead in the example in the documentation. See issue #39088.
2017-01-19Auto merge of #38464 - clarcharr:ip_cmp, r=sfacklerbors-4/+100
PartialEq and PartialOrd between IpAddr and Ipv[46]Addr. PartialEq was rather useful, so, I figured that I'd implement it. I added PartialOrd for good measure.
2017-01-19Auto merge of #38712 - clarcharr:duration_sum, r=sfacklerbors-0/+15
Sum for Duration Implemented the `Sum` trait for `Duration`. Seems reasonable.
2017-01-16Rollup merge of #39065 - frewsxcv:libstd-os-unix-ffi-docs, r=GuillaumeGomezGuillaume Gomez-3/+57
Add doc examples & description in `std::os::unix::ffi`. None
2017-01-16Rollup merge of #39028 - frewsxcv:libstd-env-docs, r=brsonGuillaume Gomez-8/+12
Minor improvements to docs in std::env structures/functions. * Call functions "functions" instead of "methods". * Link structures to their constructor functions * Add other misc. documentation links
2017-01-16Auto merge of #39076 - ollie27:rustdoc_stab_prim, r=GuillaumeGomezbors-0/+22
rustdoc: Give primitive types stability attributes This is especially important for i128/u128 to make it clear they are unstable in the docs.
2017-01-16Expose a feature to force use of alloc_system, teach rustbuildAidan Hobson Sayers-4/+6
This fixes jemalloc-less local rebuilds, where we tell cargo that we're actually stage1
2017-01-15rustdoc: Give primitive types stability attributesOliver Middleton-0/+22
This is especially important for i128/u128 to make it clear they are unstable in the docs.
2017-01-15Auto merge of #39045 - redox-os:process_try_wait, r=brsonbors-0/+14
Add try_wait to Redox process This implements Process::try_wait on Redox