about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2016-02-26Rollup merge of #31893 - tshepang:comma, r=steveklabnikManish Goregaokar-1/+1
2016-02-26Rollup merge of #31878 - frewsxcv:path-cleanup, r=alexcrichtonManish Goregaokar-6/+3
None
2016-02-26Make sure formatter errors are emitted by the default Write::write_fmtUlrik Sverdrup-1/+8
Previously, if an error was returned from the formatter that did not originate in an underlying writer error, Write::write_fmt would return successfully even if the formatting did not complete (was interrupted by an `fmt::Error` return). Now we choose to emit an io::Error with kind Other for formatter errors. Since this may reveal error returns from `write!()` and similar that previously passed silently, it's a kind of a [breaking-change].
2016-02-25doc: follow the idiom of adding a trailing commaTshepang Lekhonkhobe-1/+1
2016-02-25doc: that explanation was a messTshepang Lekhonkhobe-2/+1
2016-02-25doc: add missing commaTshepang Lekhonkhobe-1/+1
2016-02-25Add f32 and f64 examples warningGuillaume Gomez-0/+6
2016-02-25Rollup merge of #31362 - jseyfried:fix_extern_crate_visibility, r=nikomatsakisManish Goregaokar-1/+1
This PR changes the visibility of extern crate declarations to match that of items (fixes #26775). To avoid breakage, the PR makes it a `public_in_private` lint to reexport a private extern crate, and it adds the lint `inaccessible_extern_crate` for uses of an inaccessible extern crate. The lints can be avoided by making the appropriate `extern crate` declaration public.
2016-02-24Prefer 'match' pattern guard over conditional within body.Corey Farwell-5/+2
2016-02-24Prefer `slice::get` over length check with indexing.Corey Farwell-1/+1
2016-02-25rand: Fix filling buffers 4 GiB or larger with OsRng::fill_bytes on WindowsOliver Middleton-7/+11
CryptGenRandom takes a DWORD (u32) for the length so it only supports writing u32::MAX bytes at a time. Casting the length from a usize caused truncation meaning the whole buffer was not always filled.
2016-02-25Rollup merge of #31843 - Wafflespeanut:bool_docs, r=steveklabnikManish Goregaokar-1/+44
fixes #29332 r? @steveklabnik
2016-02-25Rollup merge of #31842 - dileepbapat:master, r=alexcrichtonManish Goregaokar-9/+6
I have made changes and built it after that. Please advise, https://github.com/rust-lang/rust/issues/31820
2016-02-24std: Cap read/write limits on Windows networkingAlex Crichton-5/+10
Similar to #31825 where the read/write limits were capped for files, this implements similar limits when reading/writing networking types. On Unix this shouldn't affect anything because the write size is already a `usize`, but on Windows this will cap the read/write amounts to `i32::max_value`. cc #31841
2016-02-24Auto merge of #31782 - pitdicker:clean_out_windows_c, r=alexcrichtonbors-210/+38
I am not entirely sure I have got everything right, but if it compiles it is ok probably... I tested it with msvc x86_64 and gnu. Somehow a lot of `EXCEPTION-*` constants are dead code when running test, no idea why. I have put `#![cfg_attr(test, allow(dead_code))]` at the top for this.
2016-02-24Auto merge of #31778 - aturon:snapshot, r=alexcrichtonbors-71/+23
r? @alexcrichton
2016-02-24Warn when reexporting a private extern crateJeffrey Seyfried-1/+1
2016-02-23Auto merge of #30614 - arcnmx:cstr-bytes, r=alexcrichtonbors-0/+78
I'm a bit iffy on the return type, but `Result` would also be a bit weird... The two error cases are `Unterminated` and `InteriorNul(usize)`. I considered `from_chars(&[c_char])` but this meshes better with `as_bytes_with_nul()` and Rust code in general. Should there also be a corresponding unsafe `from_bytes_unchecked` variant?
2016-02-24Updated the primitive docs for boolRavi Shankar-1/+44
2016-02-23Auto merge of #31751 - gkoz:os_str_path_cmp, r=aturonbors-6/+113
2016-02-23CStr::from_bytes_with_nul testsarcnmx-0/+27
2016-02-23#31820 - Utilize `if..let` instead of single `match` branchdileepb-9/+6
2016-02-23Register new snapshotsAaron Turon-71/+23
2016-02-23Link cstr from_bytes to tracking issuearcnmx-5/+5
2016-02-23Rename CStr::from_bytes to from_bytes_with_nularcnmx-5/+5
2016-02-23CStr::from_bytesarcnmx-0/+51
2016-02-23Fix reading/writing 4 GiB or larger files on Windows 64-bitOliver Middleton-5/+11
`ReadFile` and `WriteFile` take a DWORD (u32) for the length argument which was erroneously cast from a usize causing truncation. This meant methods like `write_all` and `read_exact` would unexpectedly fail if given a buffer 4 GiB or larger. We can instead just ask for `u32::MAX` bytes if the given buffer is too big.
2016-02-22Auto merge of #31813 - nbaksalyar:solaris-fix, r=sanxiynbors-2/+3
A quick fix for several issues that break a Solaris/Illumos build. Also, adds a CPU target specification (as seen in a patch for OpenBSD #31727).
2016-02-22Auto merge of #31811 - alexcrichton:clean-deps, r=sanxiynbors-1/+0
The standard library doesn't depend on rustc_bitflags, so move it to explicit dependencies on all other crates. Additionally, the arena/fmt_macros deps could be dropped from libsyntax.
2016-02-22Auto merge of #31805 - cuviper:android-lfs, r=alexcrichtonbors-1/+4
Android should use 64-bit LFS symbols for `lseek` and `ftruncate`, lest those offset parameters suffer a lossy cast down to a 32-bit `off_t`. Unlike GNU/Linux, Android's `stat`, `dirent`, and related functions are always 64-bit LFS compatible, and `open` already implies `O_LARGEFILE`, so all those don't need to follow Linux. It might be nice to unify them anyway, but those other LFS symbols aren't present in API 18 bionic. r? @alexcrichton
2016-02-21Auto merge of #31810 - gandro:netbsd-fix-stat, r=alexcrichtonbors-10/+29
Some struct members have a slighty different name on NetBSD. This has been fixed in the libc crate, but not in libstd, breaking the NetBSD build. Related C struct definition: http://nxr.netbsd.org/xref/src/sys/sys/stat.h?r=1.68#59 This also removes the broken `st_spare()` from MetadataExt, since it is private field reserved for future use. @dhuseby In case this conflicts with any of your pending patches, feel free to intervene - I'm happy to withdraw this PR. r? @alexcrichton
2016-02-22Fix broken Solaris buildNikita Baksalyar-2/+3
2016-02-21RaiseException is used by everything except x86 gnuPaul Dicker-0/+1
2016-02-21Auto merge of #31792 - Zoxc:sysroot, r=alexcrichtonbors-0/+7
With these changes you can build a freestanding sysroot without using floating points using a Cargo.toml and copying the `deps` folder cargo outputs. ``` [package] name = "sysroot" version = "0.1.0" [lib] path = "lib.rs" crate-type = ["rlib"] [dependencies.core] path = "../vendor/rust/src/src/libcore" features = ["disable_float"] [dependencies] collections = { path = "../vendor/rust/src/src/libcollections" } ```
2016-02-21rustbuild: Sync some Cargo.toml/lib.rs dependenciesAlex Crichton-1/+0
The standard library doesn't depend on rustc_bitflags, so move it to explicit dependencies on all other crates. Additionally, the arena/fmt_macros deps could be dropped from libsyntax.
2016-02-21Fixes for 32-bitPaul Dicker-10/+11
2016-02-21Fix `struct stat` usage on NetBSDSebastian Wicki-10/+29
Some struct members have a slighty different name on NetBSD. This has been fixed in the libc crate, but not in libstd. This also removes `st_spare` from MetadataExt, since it is private field reserved for future use.
2016-02-21Fix liballoc dependenciesJohn Kåre Alsaker-0/+7
2016-02-21std: Use Android LFS off64_t, ftruncate64, and lseek64Josh Stone-1/+4
Android should use 64-bit LFS symbols for `lseek` and `ftruncate`, lest those offset parameters suffer a lossy cast down to a 32-bit `off_t`. Unlike GNU/Linux, Android's `stat`, `dirent`, and related functions are always 64-bit LFS compatible, and `open` already implies `O_LARGEFILE`, so all those don't need to follow Linux. It might be nice to unify them anyway, but those other LFS symbols aren't present in API 18 bionic. r? @alexcrichton
2016-02-20Auto merge of #31608 - frewsxcv:osstring-simple-functions, r=alexcrichtonbors-0/+268
https://github.com/rust-lang/rust/issues/29453
2016-02-20Add Capacity/length methods for OsString.Corey Farwell-0/+268
https://github.com/rust-lang/rust/issues/29453
2016-02-20Remove dead code from sys::windows::cPaul Dicker-210/+36
2016-02-19Rollup merge of #31765 - tshepang:shorten, r=steveklabnikSteve Klabnik-1/+1
2016-02-19Rollup merge of #31764 - tshepang:overlong-sentence, r=steveklabnikSteve Klabnik-1/+1
2016-02-19Rollup merge of #31763 - tshepang:extraneous-word, r=steveklabnikSteve Klabnik-1/+1
2016-02-19Rollup merge of #31737 - dhuseby:netbsd_fixes, r=alexcrichtonSteve Klabnik-2/+2
this fixes a small compile error when building for netbsd.
2016-02-19Auto merge of #31742 - frewsxcv:needless-lifetimes, r=pnkfelixbors-2/+2
These explicit lifetimes can be ommitted because of lifetime elision rules. Instances were found using rust-clippy.
2016-02-19Auto merge of #31738 - seanmonstar:sys-rand, r=alexcrichtonbors-168/+167
2016-02-18Auto merge of #31684 - tmiasko:alternate-stack, r=alexcrichtonbors-5/+24
Remove alternate stack with sigaltstack before unmaping it. Also reuse existing signal stack if already set, this is especially useful when working with sanitizers that configure alternate stack themselves. This change depends on SS_DISABLE recently introduced in libc crate and updates this git submodule accordingly.
2016-02-18doc: make the sentence more simpleTshepang Lekhonkhobe-1/+1