summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2015-03-23Clarify that slices don't just point to arraysSteve Klabnik-5/+5
Fixes #23632
2015-03-23Beef up BufRead::consume documentation.Steve Klabnik-0/+6
Fixes #23196
2015-03-23Clarify behavior of Path::relative_fromBrian Anderson-0/+3
2015-03-23derive missing trait implementations for cursorJulian Orth-0/+1
2015-03-23implement `Clone` for various iteratorsAndrew Paseltiner-0/+25
2015-03-23Fix dead link for std::sync::mpsc.Wangshan Lu-1/+1
2015-03-23min_stack_size: clarify both reasons to use dlsymAnders Kaseorg-5/+6
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2015-03-23min_stack_size: update non-Linux implementation commentAnders Kaseorg-2/+2
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2015-03-23Get __pthread_get_minstack at runtime with dlsymAnders Kaseorg-12/+23
Linking __pthread_get_minstack, even weakly, was causing Debian’s dpkg-shlibdeps to detect an unnecessarily strict versioned dependency on libc6. Closes #23628. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2015-03-23Rollup merge of #23576 - barosl:mutex-doc, r=alexcrichtonManish Goregaokar-2/+2
2015-03-23Rollup merge of #23559 - aturon:future-proof-map-index, r=GankroManish Goregaokar-13/+1
This commit removes the `IndexMut` impls on `HashMap` and `BTreeMap`, in order to future-proof the API against the eventual inclusion of an `IndexSet` trait. Ideally, we would eventually be able to support: ```rust map[owned_key] = val; map[borrowed_key].mutating_method(arguments); &mut map[borrowed_key]; ``` but to keep the design space as unconstrained as possible, we do not currently want to support `IndexMut`, in case some other strategy will eventually be needed. Code currently using mutating index notation can use `get_mut` instead. [breaking-change] Closes #23448 r? @Gankro
2015-03-22Remove an unsafe function definition in __thread_local_inner.Ms2ger-5/+3
This fixes a build error when using thread_local!() in a deny(unsafe_code) scope in Servo for Android.
2015-03-22Remove bad reference to std::ioSteve Klabnik-2/+1
Closes #23540
2015-03-22Refine Cursor docstringSimonas Kazlauskas-8/+5
2015-03-21std: Tweak rt::at_exit behaviorAlex Crichton-45/+64
There have been some recent panics on the bots and this commit is an attempt to appease them. Previously it was considered invalid to run `rt::at_exit` after the handlers had already started running. Due to the multithreaded nature of applications, however, it is not always possible to guarantee this. For example [this program][ex] will show off the abort. [ex]: https://gist.github.com/alexcrichton/56300b87af6fa554e52d The semantics of the `rt::at_exit` function have been modified as such: * It is now legal to call `rt::at_exit` at any time. The return value now indicates whether the closure was successfully registered or not. Callers must now decide what to do with this information. * The `rt::at_exit` handlers will now be run for a fixed number of iterations. Common cases (such as the example shown) may end up registering a new handler while others are running perhaps once or twice, so this common condition is covered by re-running the handlers a fixed number of times, after which new registrations are forbidden. Some usage of `rt::at_exit` was updated to handle these new semantics, but deprecated or unstable libraries calling `rt::at_exit` were not updated.
2015-03-21std: Remove deprecated ptr functionsAlex Crichton-2/+2
The method with which backwards compatibility was retained ended up leading to documentation that rustdoc didn't handle well and largely ended up confusing.
2015-03-21Fix documentation for std::sync::mutex: into_guard -> into_innerBarosl Lee-2/+2
2015-03-21Auto merge of #23470 - alexcrichton:less-prelude, r=aturonbors-98/+168
This commit removes the reexports of `old_io` traits as well as `old_path` types and traits from the prelude. This functionality is now all deprecated and needs to be removed to make way for other functionality like `Seek` in the `std::io` module (currently reexported as `NewSeek` in the io prelude). Closes #23377 Closes #23378
2015-03-20std: Remove old_io/old_path from the preludeAlex Crichton-98/+168
This commit removes the reexports of `old_io` traits as well as `old_path` types and traits from the prelude. This functionality is now all deprecated and needs to be removed to make way for other functionality like `Seek` in the `std::io` module (currently reexported as `NewSeek` in the io prelude). Closes #23377 Closes #23378
2015-03-20Auto merge of #23512 - oli-obk:result_ok_unwrap, r=alexcrichtonbors-15/+15
because then the call to `unwrap()` will not print the error object.
2015-03-20Auto merge of #23267 - alexcrichton:issue-20012, r=aturonbors-37/+56
This reverts commit aec67c2. Closes #20012 This is temporarily rebased on #23245 as it would otherwise conflict, the last commit is the only one relevant to this PR though.
2015-03-20Revert "Revert "std: Re-enable at_exit()""Alex Crichton-37/+56
This reverts commit aec67c2ee0f673ea7b0e21c2fe7e0f26a523d823.
2015-03-20Future-proof indexing on maps: remove IndexMutAaron Turon-13/+1
This commit removes the `IndexMut` impls on `HashMap` and `BTreeMap`, in order to future-proof the API against the eventual inclusion of an `IndexSet` trait. Ideally, we would eventually be able to support: ```rust map[owned_key] = val; map[borrowed_key].mutating_method(arguments); &mut map[borrowed_key]; ``` but to keep the design space as unconstrained as possible, we do not currently want to support `IndexMut`, in case some other strategy will eventually be needed. Code currently using mutating index notation can use `get_mut` instead. [breaking-change] Closes #23448
2015-03-20don't use Result::ok just to be able to use unwrap/unwrap_orOliver Schneider-15/+15
2015-03-20Rollup merge of #23534 - steveklabnik:remove_sched_threads, r=alexcrichtonManish Goregaokar-24/+1
As @alexcrichton says, this was really a libgreen thing, and isn't relevant now. As this removes a technically-public function, this is a [breaking-change]
2015-03-20Rollup merge of #23499 - mbrubeck:doc-edit, r=huonwManish Goregaokar-1/+2
Multiple people have been suprised by this aspect of read_line's behavior, which is not obvious from the docs.
2015-03-20Rollup merge of #22631 - aepsil0n:issue-22098, r=aturonManish Goregaokar-9/+9
Fixes #22098.
2015-03-20Rollup merge of #23529 - steveklabnik:gh23426, r=alexcrichtonManish Goregaokar-0/+5
Fixes #23426
2015-03-20Rollup merge of #23504 - alexcrichton:parse-error-not-unit, r=aturonManish Goregaokar-11/+17
The IP and socket address types all had `FromStr` implemented but the implementations were not marked stable, nor was the error type returned ready to be properly stabilized. This commit marks the implementations of `FromStr` as stable and also renamed the `ParseError` structure to `AddrParseError`. The error is now also an opaque structure that cannot be constructed outside the standard library. cc #22949 [breaking-change]
2015-03-20Remove rt::default_sched_threads and RUST_THREADS.Steve Klabnik-24/+1
As @alexcrichton says, this was really a libgreen thing, and isn't relevant now. As this removes a technically-public function, this is a [breaking-change] Conflicts: src/libtest/lib.rs
2015-03-19Comment on when ReadDir is ErrSteve Klabnik-0/+5
Fixes #23426
2015-03-19Auto merge of #23430 - alexcrichton:io-error, r=aturonbors-48/+81
This commit stabilizes the `ErrorKind` enumeration which is consumed by and generated by the `io::Error` type. The purpose of this type is to serve as a cross-platform namespace to categorize errors into. Two specific issues are addressed as part of this stablization: * The naming of each variant was scrutinized and some were tweaked. An example is how `FileNotFound` was renamed to simply `NotFound`. These names should not show either a Unix or Windows bias and the set of names is intended to grow over time. For now the names will likely largely consist of those errors generated by the I/O APIs in the standard library. * The mapping of OS error codes onto kinds has been altered. Coalescing no longer occurs (multiple error codes become one kind). It is intended that each OS error code, if bound, corresponds to only one `ErrorKind`. The current set of error kinds was expanded slightly to include some networking errors. This commit also adds a `raw_os_error` function which returns an `Option<i32>` to extract the underlying raw error code from the `Error`. Closes #16666 [breaking-change]
2015-03-19std: Stablize io::ErrorKindAlex Crichton-48/+81
This commit stabilizes the `ErrorKind` enumeration which is consumed by and generated by the `io::Error` type. The purpose of this type is to serve as a cross-platform namespace to categorize errors into. Two specific issues are addressed as part of this stablization: * The naming of each variant was scrutinized and some were tweaked. An example is how `FileNotFound` was renamed to simply `NotFound`. These names should not show either a Unix or Windows bias and the set of names is intended to grow over time. For now the names will likely largely consist of those errors generated by the I/O APIs in the standard library. * The mapping of OS error codes onto kinds has been altered. Coalescing no longer occurs (multiple error codes become one kind). It is intended that each OS error code, if bound, corresponds to only one `ErrorKind`. The current set of error kinds was expanded slightly to include some networking errors. This commit also adds a `raw_os_error` function which returns an `Option<i32>` to extract the underlying raw error code from the `Error`.
2015-03-19Allow Float::ldexp to be called as a methodEduard Bopp-9/+9
Fixes #22098.
2015-03-19Auto merge of #23507 - jbcrail:fix-comment-spelling, r=alexcrichtonbors-5/+5
I corrected misspelled comments in several crates.
2015-03-18Stabilize Entry typesAaron Turon-8/+8
This commit marks as `#[stable]` the `Entry` types for the maps provided by `std`. The main reason these had been left unstable previously was uncertainty about an eventual trait design, but several plausible designs have been proposed that all work fine with the current type definitions.
2015-03-19Fix spelling errors in comments.Joseph Crail-5/+5
I corrected misspelled comments in several crates.
2015-03-19Rollup merge of #23496 - steveklabnik:gh22309, r=nikomatsakisManish Goregaokar-0/+14
Fixes #22309 I am pretty sure that this is the right way to do this, given the other macros, but I'm not 100% sure.
2015-03-19Rollup merge of #23483 - semarie:openbsd-threads, r=alexcrichtonManish Goregaokar-4/+2
unbreak openbsd/bitrig build - remove `pub` from `struct` (error: visibility has no effect inside functions) - move `pthread_main_np` into function r? @alexcrichton
2015-03-19Rollup merge of #23479 - tamird:fix-ios-build, r=aturonManish Goregaokar-3/+2
r? @aturon
2015-03-18std: Stabilize FromStr implementations in std::netAlex Crichton-11/+17
The IP and socket address types all had `FromStr` implemented but the implementations were not marked stable, nor was the error type returned ready to be properly stabilized. This commit marks the implementations of `FromStr` as stable and also renamed the `ParseError` structure to `AddrParseError`. The error is now also an opaque structure that cannot be constructed outside the standard library. cc #22949 [breaking-change]
2015-03-19Document include!Steve Klabnik-0/+14
Fixes #22309
2015-03-19Rollup merge of #23468 - sfackler:stdio-panic, r=alexcrichtonManish Goregaokar-3/+29
Nothing inside of the read/write interface itself can panic, so any poison must have been the result of user code which the lock isn't protecting. This seems safe to me, but if we don't want to go this route we should update the docs to indicate that these methods can panic. r? @alexcrichton
2015-03-18Clarify in docs that BufRead::read_line appendsMatt Brubeck-1/+2
Multiple people have been suprised by this aspect of read_line's behavior, which is not obvious from the docs.
2015-03-18Register new snapshotsAlex Crichton-155/+5
2015-03-18Rollup merge of #23443 - meqif:ipv6addr-new-documentation-fix, r=steveklabnikManish Goregaokar-1/+1
Very minor fix: in `std::net::Ipv6Addr::new`, the documentation had an incomplete representation of the resulting address, missing the last two groups.
2015-03-18Rollup merge of #23392 - WiSaGaN:bugfix/fix_deprecate_link, r=ManishearthManish Goregaokar-4/+4
Since module `std::sync::mpsc` is stable now, fix the deprecated link `comm` with `sync::mpsc`.
2015-03-18Rollup merge of #23461 - alexcrichton:feat-char-at, r=aturonManish Goregaokar-0/+1
This commit clarifies some of the unstable features in the `str` module by moving them out of the blanket `core` and `collections` features. The following methods were moved to the `str_char` feature which generally encompasses decoding specific characters from a `str` and dealing with the result. It is unclear if any of these methods need to be stabilized for 1.0 and the most conservative route for now is to continue providing them but to leave them as unstable under a more specific name. * `is_char_boundary` * `char_at` * `char_range_at` * `char_at_reverse` * `char_range_at_reverse` * `slice_shift_char` The following methods were moved into the generic `unicode` feature as they are specifically enabled by the `unicode` crate itself. * `nfd_chars` * `nfkd_chars` * `nfc_chars` * `graphemes` * `grapheme_indices` * `width`
2015-03-18Add a testSteven Fackler-0/+26
2015-03-18iOS: fallout from 1d5983aTamir Duberstein-3/+2