summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
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
2016-02-18doc: reduce overlong sentenceTshepang Lekhonkhobe-1/+1
2016-02-18doc: remove a word that makes the sentence hard to readTshepang Lekhonkhobe-1/+1
2016-02-18Auto merge of #31734 - aliclark:bsd-stat-fixes, r=alexcrichtonbors-131/+63
In https://github.com/rust-lang/rust/issues/25155 the os::freebsd::raw stat was split for the x86 vs. x86-64 cases, which appears to have been done to implement the padding on the end of struct stat for the x86 case (the struct is otherwise the same notwistanding the size of long). This PR de-duplicates the struct using #[cfg(target_arch = "x86")] for the __unused field, which also fixes the definitions which had sinced changed with the LFS work d088b671872f1df6993ccca6fa6139ebed0a8cf3. Also changed definitions to c_long for dragonfly and freebsd where appropriate. Also removes some unused imports that the compiler was complaining about. dragonfly's long time_t: https://gitweb.dragonflybsd.org/dragonfly.git/blob/a2a57c243ff8016578bc559f8603fb25bbcf1768:/lib/libstand/machine/stdint.h freebsd's long time_t: https://svnweb.freebsd.org/base/release/10.1.0/sys/x86/include/_types.h?view=markup https://github.com/rust-lang/rust/blob/d088b671872f1df6993ccca6fa6139ebed0a8cf3/src/liblibc/lib.rs#L980 freebsd's padding for i686 stat: https://svnweb.freebsd.org/base/release/10.1.0/sys/sys/stat.h?view=markup#l139 https://github.com/rust-lang/rust/blob/d088b671872f1df6993ccca6fa6139ebed0a8cf3/src/liblibc/lib.rs#L1038
2016-02-18Add mutual PartialEq and PartialOrd impls for Path[Buf] and OsStr[ing]Gleb Kozyrev-0/+47
2016-02-18Add mutual PartialOrd impls for Path and PathBufGleb Kozyrev-6/+21
2016-02-18Impl AsRef<Path> for Cow<OsStr>Gleb Kozyrev-0/+7
2016-02-18Add mutual PartialEq and PartialCmp impls for OsStr, OsStringGleb Kozyrev-0/+38
2016-02-18Remove unnecessary explicit lifetime bounds.Corey Farwell-2/+2
These explicit lifetimes can be ommitted because of lifetime elision rules. Instances were found using rust-clippy.
2016-02-18Auto merge of #31728 - Amanieu:recoversafe_into_inner, r=alexcrichtonbors-0/+6
This allows a `FnOnce` to be wrapped in an `AssertRecoverSafe`.
2016-02-18Remove alternate stack with sigaltstack before unmapping it.Tomasz Miąsko-5/+24
Also reuse existing signal stack if already set, this is especially useful when working with sanitizers that configure alternate stack themselves.
2016-02-17std: restructure rand os code into sys modulesSean McArthur-168/+167
2016-02-17Rollup merge of #31733 - gkoz:strip_prefix_docs, r=alexcrichtonSteve Klabnik-1/+3
It wasn't fixed after copy-pasting. This probably needs to be backported to beta.
2016-02-17Rollup merge of #31695 - oconnor663:chardocs, r=alexcrichtonSteve Klabnik-21/+11
Previously the docs suggested that '❤️' doesn't fit in a char because it's 6 bytes. But that's misleading. 'a̚' also doesn't fit in a char, even though it's only 3 bytes. The important thing is the number of code points, not the number of bytes. Clarify the primitive char docs around this.
2016-02-17Rollup merge of #31694 - oconnor663:insertdocs, r=steveklabnikSteve Klabnik-6/+10
The first time I read the docs for `insert()`, I thought it was saying it didn't update existing *values*, and I was confused. Reword the docs to make it clear that `insert()` does update values.
2016-02-17fixes a small netbsd compile errorDave Huseby-2/+2