summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2016-09-12memrchr: Use a conditional instead of subtracting a complicated minUlrik Sverdrup-1/+1
This makes the critical calculation easier to understand.
2016-09-12memrchr: Correct aligned offset computationUlrik Sverdrup-1/+23
The memrchr fallback did not compute the offset correctly. It was intentioned to land on usize-aligned addresses but did not. This was suspected to resulted in a crash on ARMv7 platform! This bug affected non-linux platforms. I think like this, if we have a slice with pointer `ptr` and length `len`, we want to find the last usize-aligned offset in the slice. The correct computation should be: For example if ptr = 1 and len = 6, and size_of::<usize>() is 4: [ x x x x x x ] 1 2 3 4 5 6 ^-- last aligned address at offset 3 from the start. The last aligned address is ptr + len - (ptr + len) % usize_size. Compute offset from the start as: offset = len - (ptr + len) % usize_size = 6 - (1 + 6) % 4 = 6 - 3 = 3. I believe the function's return value was always correct previously, if the platform supported unaligned addresses.
2016-08-22std: Stabilize APIs for the 1.12 releaseAlex Crichton-24/+23
Stabilized * `Cell::as_ptr` * `RefCell::as_ptr` * `IpAddr::is_{unspecified,loopback,multicast}` * `Ipv6Addr::octets` * `LinkedList::contains` * `VecDeque::contains` * `ExitStatusExt::from_raw` - both on Unix and Windows * `Receiver::recv_timeout` * `RecvTimeoutError` * `BinaryHeap::peek_mut` * `PeekMut` * `iter::Product` * `iter::Sum` * `OccupiedEntry::remove_entry` * `VacantEntry::into_key` Deprecated * `Cell::as_unsafe_cell` * `RefCell::as_unsafe_cell` * `OccupiedEntry::remove_pair` Closes #27708 cc #27709 Closes #32313 Closes #32630 Closes #32713 Closes #34029 Closes #34392 Closes #34285 Closes #34529
2016-08-14Rollup merge of #35574 - badboy:emscripten-test-fixes, r=brsonEduard-Mihai Burtescu-8/+9
Emscripten test fixes This picks up parts of #31623 to disable certain tests that emscripten can't run, as threads/processes are not supported. I re-applied @tomaka's changes manually, I can rebase those commits with his credentials if he wants. It also disables jemalloc for emscripten (at least in Rustbuild, I have to check if there is another setting for the same thing in the old makefile approach). This should not impact anything for normal builds.
2016-08-14Rollup merge of #35444 - alexcrichton:optimize-catch-unwind, r=brsonEduard-Mihai Burtescu-36/+68
std: Optimize panic::catch_unwind slightly The previous implementation of this function was overly conservative with liberal usage of `Option` and `.unwrap()` which in theory never triggers. This commit essentially removes the `Option`s in favor of unsafe implementations, improving the code generation of the fast path for LLVM to see through what's happening more clearly. cc #34727
2016-08-14Rollup merge of #34941 - qolop:patch-2, r=apasel422Eduard-Mihai Burtescu-2/+2
Fix typo (privledge->privilege)
2016-08-11Fix typoPatrick McCann-1/+1
Didn't see this one at first.
2016-08-11std: Optimize panic::catch_unwind slightlyAlex Crichton-36/+68
The previous implementation of this function was overly conservative with liberal usage of `Option` and `.unwrap()` which in theory never triggers. This commit essentially removes the `Option`s in favor of unsafe implementations, improving the code generation of the fast path for LLVM to see through what's happening more clearly. cc #34727
2016-08-11Rollup merge of #35569 - pietroalbini:fix-typo, r=steveklabnikJonathan Turner-1/+1
Fix docs typo in std::os::unix::net::SocketAddr::is_unnamed
2016-08-11Rollup merge of #35482 - frewsxcv:patch-31, r=GuillaumeGomezJonathan Turner-17/+9
Remove unnecessary `main` functions in doc examples.
2016-08-11Auto merge of #34866 - cynicaldevil:panic-counter, r=alexcrichtonbors-23/+40
Refactored code to access TLS only in case of panic (II) Fixes #34787 r? @alexcrichton Do it **very** carefully this time!
2016-08-10Auto merge of #35525 - jonathandturner:rollup, r=jonathandturnerbors-7/+6
Rollup of 15 pull requests - Successful merges: #35371, #35396, #35446, #35449, #35452, #35458, #35465, #35466, #35470, #35475, #35477, #35484, #35504, #35507, #35524 - Failed merges: #35395, #35415
2016-08-10Added an update_panic_count function to handle access to PANIC_COUNTNikhil Shagrithaya-23/+28
2016-08-10Added a shim around rust_panic to update panic counterNikhil Shagrithaya-1/+11
2016-08-10Refactored code to access TLS only in case of panicNikhil Shagrithaya-9/+11
2016-08-10Clarify std::os::unix::net::SocketAddr::is_unnamed's docstringPietro Albini-1/+1
2016-08-10Fix docs typo in std::os::unix::net::SocketAddr::is_unnamedPietro Albini-1/+1
2016-08-10[emscripten] Disable code paths that don't work on emscriptenJan-Erik Rediger-8/+9
2016-08-09Auto merge of #35426 - frewsxcv:os-sys-env-args-phantoms, r=alexcrichtonbors-6/+7
Utilize `PhantomData` to enforce `!Sync` and `!Send` field. None
2016-08-09Auto merge of #35425 - apasel422:refcell, r=alexcrichtonbors-0/+16
Implement `RefCell::{try_borrow, try_borrow_mut}` CC #35070 r? @alexcrichton
2016-08-08Implement `RefCell::{try_borrow, try_borrow_mut}`Andrew Paseltiner-0/+16
2016-08-08Rollup merge of #35371 - mgattozzi:master, r=steveklabnikJonathan Turner-7/+6
Update HashMap docs regarding DoS protection Because of changes to how Rust acquires randomness HashMap is not guaranteed to be DoS resistant. This commit reflects these changes in the docs themselves and provides an alternative method to creating a hash that is resistant if needed. This fixes #33817 and includes relevant information regarding changes made in #33086
2016-08-08Remove unnecessary `main` functions in doc examples.Corey Farwell-17/+9
2016-08-07Rollup merge of #35436 - frewsxcv:into-vec, r=GuillaumeGomezJonathan Turner-0/+9
Add doc example for `std::ffi::NulError::into_vec`. None
2016-08-07Rollup merge of #35433 - mneumann:dragonfly-fix-libstd-errno-location, ↵Jonathan Turner-0/+1
r=alexcrichton Fix build on DragonFly (unused function errno_location) Function errno_location() is not used on DragonFly. As warnings are errors, this breaks the build.
2016-08-07Utilize `PhantomData` to enforce `!Sync` and `!Send` field.Corey Farwell-6/+7
2016-08-06Auto merge of #35378 - Amanieu:rwlock_eagain, r=alexcrichtonbors-1/+3
Handle RwLock reader count overflow `pthread_rwlock_rdlock` may return `EAGAIN` if the maximum reader count overflows. We shouldn't return a successful lock in that case.
2016-08-06Add doc example for `std::ffi::NulError::into_vec`.Corey Farwell-0/+9
2016-08-06Fix build on DragonFly (unused function errno_location)Michael Neumann-0/+1
Function errno_location() is not used on DragonFly. As warnings are errors, this breaks the build.
2016-08-06Rollup merge of #34916 - tbu-:pr_comment_on_seek_cast, r=GuillaumeGomezEduard-Mihai Burtescu-4/+8
Comment on the casts in the `seek` implementations on files
2016-08-05Handle RwLock reader count overflowAmanieu d'Antras-1/+3
2016-08-05Comment on the casts in the `seek` implementations on filesTobias Bucher-4/+8
2016-08-05Update HashMap docs regarding DoS protectionMichael Gattozzi-7/+6
Because of changes to how Rust acquires randomness HashMap is not guaranteed to be DoS resistant. This commit reflects these changes in the docs themselves and provides an alternative method to creating a hash that is resistant if needed.
2016-08-05Rollup merge of #35239 - dns2utf8:doc_park_timeout, r=steveklabnikGuillaume Gomez-1/+25
Doc `std::thread::park_timeout` r? @steveklabnik
2016-08-05Rollup merge of #35182 - frewsxcv:nulerror, r=steveklabnikGuillaume Gomez-0/+12
Add doc example for `std::ffi::NulError::nul_position`. None
2016-08-05Rollup merge of #35175 - frewsxcv:tcp, r=GuillaumeGomezGuillaume Gomez-1/+10
A couple `std::net` doc improvements. None
2016-08-05Rollup merge of #35109 - GuillaumeGomez:io_docs, r=steveklabnikGuillaume Gomez-2/+222
Add io::Error doc examples Fixes #29359. r? @steveklabnik
2016-08-05Rollup merge of #35076 - GuillaumeGomez:file_type_docs, r=steveklabnikGuillaume Gomez-1/+59
Add doc examples for FileType struct Part of #29356. r? @steveklabnik
2016-08-03Add link to replacement functionStefan Schindler-1/+6
2016-08-03Add an example to `std::thread::park_timeout`Stefan Schindler-0/+19
2016-08-03Add doc examples for FileType structGuillaume Gomez-1/+59
2016-08-02Add doc example for `std::ffi::NulError::nul_position`.Corey Farwell-0/+12
2016-08-02Auto merge of #35084 - tbu-:pr_lowercase_wtf8_debug, r=brsonbors-2/+2
Escape the unmatched surrogates with lower-case hexadecimal numbers It's done the same way for the rest of the codepoint escapes.
2016-08-01Link to relevant method/struct for `std::net::Shutdown` docs.Corey Farwell-1/+5
2016-08-01Indicate where the `std::net::Incoming` struct is created.Corey Farwell-0/+5
2016-07-30remove some `any`s that are no longer necessaryJorge Aparicio-3/+3
2016-07-30arm-musl targets now use cfg(env = "musl")Jorge Aparicio-9/+3
2016-07-30Add ARM MUSL targets.Timon Van Overveldt-3/+9
The targets are: - `arm-unknown-linux-musleabi` - `arm-unknown-linux-musleabihf` - `armv7-unknown-linux-musleabihf` These mirror the existing `gnueabi` targets. All of these targets produce fully static binaries, similar to the x86 MUSL targets. For now these targets can only be used with `--rustbuild` builds, as https://github.com/rust-lang/compiler-rt/pull/22 only made the necessary compiler-rt changes in the CMake configs, not the plain GNU Make configs. I've tested these targets GCC 5.3.0 compiled again musl-1.1.12 (downloaded from http://musl.codu.org/). An example `./configure` invocation is: ``` ./configure \ --enable-rustbuild --target=arm-unknown-linux-musleabi \ --musl-root="$MUSL_ROOT" ``` where `MUSL_ROOT` points to the `arm-linux-musleabi` prefix. Usually that path will be of the form `/foobar/arm-linux-musleabi/arm-linux-musleabi`. Usually the cross-compile toolchain will live under `/foobar/arm-linux-musleabi/bin`. That path should either by added to your `PATH` variable, or you should add a section to your `config.toml` as follows: ``` [target.arm-unknown-linux-musleabi] cc = "/foobar/arm-linux-musleabi/bin/arm-linux-musleabi-gcc" cxx = "/foobar/arm-linux-musleabi/bin/arm-linux-musleabi-g++" ``` As a prerequisite you'll also have to put a cross-compiled static `libunwind.a` library in `$MUSL_ROOT/lib`. This is similar to [how the x86_64 MUSL targets are built] (https://doc.rust-lang.org/book/advanced-linking.html).
2016-07-30Update gcc crate dependency to 0.3.27.Timon Van Overveldt-1/+1
This is to pull in changes to support ARM MUSL targets. This change also commits a couple of other cargo-generated changes to other dependencies in the various Cargo.toml files.
2016-07-30Add urls in std::io typesGuillaume Gomez-2/+14