summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2014-11-21libs: stabilize ascii moduleAaron Turon-9/+52
This is an initial API stabilization pass for `std::ascii`. Aside from some renaming to match conversion conventions, and deprecations in favor of using iterators directly, almost nothing is changed here. However, the static case conversion tables that were previously public are now private. The stabilization of the (rather large!) set of extension traits is left to a follow-up pass, because we hope to land some more general machinery that will provide the same functionality without custom traits. [breaking-change]
2014-11-21Fix various deprecation warnings from char changesBrian Anderson-1/+2
2014-11-21unicode: Rename UnicodeChar::is_digit to is_numericBrian Anderson-2/+2
'Numeric' is the proper name of the unicode character class, and this frees up the word 'digit' for ascii use in libcore. Since I'm going to rename `Char::is_digit_radix` to `is_digit`, I am not leaving a deprecated method in place, because that would just cause name clashes, as both `Char` and `UnicodeChar` are in the prelude. [breaking-change]
2014-11-21libs: add std::os::unix moduleAaron Turon-0/+108
The new `std::os::unix` module exposes several extension traits for extracting file descriptors from `std::io` types.
2014-11-21sys: reveal std::io representation to sys moduleAaron Turon-19/+73
This commit adds a `AsInner` trait to `sys_common` and provides implementations on many `std::io` types. This is a building block for exposing platform-specific APIs that hook into `std::io` types.
2014-11-20Disable dubious pipe testAaron Turon-1/+1
2014-11-20Make most of std::rt privateAaron Turon-37/+34
Previously, the entire runtime API surface was publicly exposed, but that is neither necessary nor desirable. This commit hides most of the module, using librustrt directly as needed. The arrangement will need to be revisited when rustrt is pulled into std. [breaking-change]
2014-11-20Fallout from libgreen and libnative removalAaron Turon-124/+19
2014-11-20Remove libnativeAaron Turon-3/+77
With runtime removal complete, there's nothing left of libnative. This commit removes it. Fixes #18687 [breaking-change]
2014-11-20Remove Runtime traitAaron Turon-0/+2
This commit removes most of the remaining runtime infrastructure related to the green/native split. In particular, it removes the `Runtime` trait and instead inlines the native implementation. Closes #17325 [breaking-change]
2014-11-20auto merge of #18773 : subhashb/rust/convert_remaining_failures_to_panic, ↵bors-11/+14
r=steveklabnik I have also renamed `fail` to `panic` in some non-documentation comments, where I thought it mattered. Fixes #18677 cc @steveklabnik
2014-11-20Rename remaining Failures to PanicSubhash Bhushan-11/+14
2014-11-20auto merge of #19071 : huonw/rust/col2column, r=nikomatsakisbors-4/+4
This macro is very rarely used, so there is no need (and it is better) for it to avoid the abbreviation. Closes rust-lang/rfcs#467.
2014-11-20Rename `col!` to `column!`.Huon Wilson-4/+4
This macro is very rarely used, so there is no need (and it is better) for it to avoid the abbreviation. Closes rust-lang/rfcs#467. [breaking-change]
2014-11-20libcore: DST-ify AsSliceAaron Turon-1/+2
This commit changes `AsSlice` to work on unsized types, and changes the `impl` for `&[T]` to `[T]`. Aside from making the trait more general, this also helps some ongoing work with method resolution changes. This is a breaking change: code that uses generics bounded by `AsSlice` will have to change. In particular, such code previously often took arguments of type `V` where `V: AsSlice<T>` by value. These should now be taken by reference: ```rust fn foo<Sized? V: AsSlice<T>>(v: &V) { .. } ``` A few std lib functions have been changed accordingly. [breaking-change]
2014-11-20auto merge of #18999 : aturon/rust/stab-floats, r=alexcrichton,alexcrichtonbors-11/+29
This commit adds stability markers for the APIs that have recently been aligned with [numerics reform](https://github.com/rust-lang/rfcs/pull/369). For APIs that were changed as part of that reform, `#[unstable]` is used to reflect the recency, but the APIs will become `#[stable]` in a follow-up pass. In addition, a few aspects of the APIs not explicitly covered by the RFC are marked here -- in particular, constants for floats. This commit does not mark the `uint` or `int` modules as `#[stable]`, given the ongoing debate out the names and roles of these types. Due to some deprecation (see the RFC for details), this is a: [breaking-change] r? @alexcrichton cc @bjz
2014-11-19rollup merge of #19101: vhbit/ios-rng-fixJakub Bukaj-2/+2
2014-11-19rollup merge of #19040: alexcrichton/issue-18904Jakub Bukaj-30/+29
This commit applies the stabilization of std::fmt as outlined in [RFC 380][rfc]. There are a number of breaking changes as a part of this commit which will need to be handled to migrated old code: * A number of formatting traits have been removed: String, Bool, Char, Unsigned, Signed, and Float. It is recommended to instead use Show wherever possible or to use adaptor structs to implement other methods of formatting. * The format specifier for Boolean has changed from `t` to `b`. * The enum `FormatError` has been renamed to `Error` as well as becoming a unit struct instead of an enum. The `WriteError` variant no longer exists. * The `format_args_method!` macro has been removed with no replacement. Alter code to use the `format_args!` macro instead. * The public fields of a `Formatter` have become read-only with no replacement. Use a new formatting string to alter the formatting flags in combination with the `write!` macro. The fields can be accessed through accessor methods on the `Formatter` structure. Other than these breaking changes, the contents of std::fmt should now also all contain stability markers. Most of them are still #[unstable] or #[experimental] [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0380-stabilize-std-fmt.md [breaking-change] Closes #18904
2014-11-19rollup merge of #18944: liigo/improve-os-args-docJakub Bukaj-0/+4
2014-11-19iOS: fixed broken build after disallowed coercionsValerii Hiora-2/+2
2014-11-18std: Stabilize std::fmtAlex Crichton-30/+29
This commit applies the stabilization of std::fmt as outlined in [RFC 380][rfc]. There are a number of breaking changes as a part of this commit which will need to be handled to migrated old code: * A number of formatting traits have been removed: String, Bool, Char, Unsigned, Signed, and Float. It is recommended to instead use Show wherever possible or to use adaptor structs to implement other methods of formatting. * The format specifier for Boolean has changed from `t` to `b`. * The enum `FormatError` has been renamed to `Error` as well as becoming a unit struct instead of an enum. The `WriteError` variant no longer exists. * The `format_args_method!` macro has been removed with no replacement. Alter code to use the `format_args!` macro instead. * The public fields of a `Formatter` have become read-only with no replacement. Use a new formatting string to alter the formatting flags in combination with the `write!` macro. The fields can be accessed through accessor methods on the `Formatter` structure. Other than these breaking changes, the contents of std::fmt should now also all contain stability markers. Most of them are still #[unstable] or #[experimental] [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0380-stabilize-std-fmt.md [breaking-change] Closes #18904
2014-11-18libs: stabilize most numerics after RFC changesAaron Turon-11/+29
This commit adds stability markers for the APIs that have recently been aligned with [numerics reform](https://github.com/rust-lang/rfcs/pull/369). For APIs that were changed as part of that reform, `#[unstable]` is used to reflect the recency, but the APIs will become `#[stable]` in a follow-up pass. In addition, a few aspects of the APIs not explicitly covered by the RFC are marked here -- in particular, constants for floats. This commit does not mark the `uint` or `int` modules as `#[stable]`, given the ongoing debate out the names and roles of these types. Due to some deprecation (see the RFC for details), this is a: [breaking-change]
2014-11-19Make os::setenv() and os::unsetenv() panic if an error occursBarosl Lee-5/+14
These functions can fail if: - EINVAL: The name is empty, or contains an '=' character - ENOMEM: Insufficient memory
2014-11-19Make os::change_dir() return IoResult<()>Barosl Lee-14/+15
os::change_dir() returns bool, without a meaningful error message. Change it to return IoResult<()> to indicate what IoError caused the failure. Fixes #16315. [breaking-change]
2014-11-19Make os::getcwd() return IoResult<Path>Barosl Lee-30/+43
os::getcwd() panics if the current directory is not available. According to getcwd(3), there are three cases: - EACCES: Permission denied. - ENOENT: The current working directory has been removed. - ERANGE: The buffer size is less than the actual absolute path. This commit makes os::getcwd() return IoResult<Path>, not just Path, preventing it from panicking. As os::make_absolute() depends on os::getcwd(), it is also modified to return IoResult<Path>. Fixes #16946. [breaking-change]
2014-11-18auto merge of #19031 : nodakai/rust/libcore-pow-and-sq, r=bjzbors-3/+3
[breaking-change] Deprecates `core::num::pow` in favor of `Int::pow`.
2014-11-18auto merge of #18645 : nick29581/rust/coercions-1, r=alexcrichtonbors-19/+19
r? (I realise this needs a rebase, but I will probably have to chop it up in order to land and I'd like to get r+ first so I can do that quicker)
2014-11-18Windows and OS X falloutNick Cameron-19/+19
2014-11-18implement Writer for Vec<u8>Daniel Micay-54/+63
The trait has an obvious, sensible implementation directly on vectors so the MemWriter wrapper is unnecessary. This will halt the trend towards providing all of the vector methods on MemWriter along with eliminating the noise caused by conversions between the two types. It also provides the useful default Writer methods on Vec<u8>. After the type is removed and code has been migrated, it would make sense to add a new implementation of MemWriter with seeking support. The simple use cases can be covered with vectors alone, and ones with the need for seeks can use a new MemWriter implementation.
2014-11-18libcore: add num::Int::pow() and deprecate num::pow().NODA, Kai-3/+3
Signed-off-by: NODA, Kai <nodakai@gmail.com>
2014-11-18rollup merge of #19038: jayelm/fixed-typosJakub Bukaj-2/+2
Baby steps here... Fixed some comments in liblog, libregex, librustc, libstd.
2014-11-18rollup merge of #19016: gkoz/use_util_copyJakub Bukaj-9/+1
This code is identical to io::util::copy()
2014-11-17Fix several typos in commentsjmu303-2/+2
liblog, libregex, librustc, libstd
2014-11-17Remove bogus Duration::span testAaron Turon-7/+0
2014-11-17Fallout from deprecationAaron Turon-4/+4
This commit handles the fallout from deprecating `_with` and `_equiv` methods.
2014-11-17libstd: Deprecate _equiv methodsAaron Turon-123/+84
This commit deprecates the `_equiv` family of methods on `HashMap` and `HashSet` by instead generalizing the "normal" methods like `get` and `remove` to use the new `std::borrow` infrastructure. [breaking-change]
2014-11-17libcore: add borrow moduleAaron Turon-0/+1
Following [the collections reform RFC](https://github.com/rust-lang/rfcs/pull/235), this commit adds a new `borrow` module to libcore. The module contains traits for borrowing data (`BorrowFrom` and `BorrowFromMut`), generalized cloning (`ToOwned`), and a clone-on-write smartpointer (`Cow`).
2014-11-17Return proper errors with update_errGleb Kozyrev-1/+1
2014-11-17Remove duplicate code by using util::copy()Gleb Kozyrev-9/+1
2014-11-17Switch to purely namespaced enumsSteven Fackler-12/+64
This breaks code that referred to variant names in the same namespace as their enum. Reexport the variants in the old location or alter code to refer to the new locations: ``` pub enum Foo { A, B } fn main() { let a = A; } ``` => ``` pub use self::Foo::{A, B}; pub enum Foo { A, B } fn main() { let a = A; } ``` or ``` pub enum Foo { A, B } fn main() { let a = Foo::A; } ``` [breaking-change]
2014-11-17auto merge of #19027 : nick29581/rust/coercions-4, r=alexcrichtonbors-359/+359
The forwards compatible parts of #18645, rebased. Converts implicit coercions from `[T, ..n]` to `&[T]` into explicit references.
2014-11-17Fix fallout from coercion removalNick Cameron-359/+359
2014-11-16fallout from deprecating find_copy and get_copyAlexis Beingessner-1/+1
2014-11-16Deprecate hashmap's find_copy and get_copy in favour of cloned and cloneAlexis Beingessner-25/+7
2014-11-16Fix doctestsJakub Bukaj-2/+2
2014-11-16Fix warningsJakub Bukaj-1/+1
2014-11-16rollup merge of #18985: alexcrichton/issue-18900Jakub Bukaj-24/+22
2014-11-16rollup merge of #18976: bjz/rfc369-numericsJakub Bukaj-727/+39
2014-11-16rollup merge of #18941: reem/better-task-poolJakub Bukaj-63/+167
2014-11-16auto merge of #18788 : ricky26/rust/master, r=aturonbors-12/+25
This moves chars() and lines() out of Buffer and into separate traits (CharsBuffer and LinesBuffer respectively) - this matches the pattern used for bytes() on Reader (with BytesReader). (I came across this when I wanted a trait object of a Buffer, so that I could use read_line(); rustc errors about std::io::Buffer not being object-safe.) [breaking-change] Any uses of Buffer::lines() will need to use the new trait std::io::LinesBuffer. The same is true for Buffer::chars() with std::io::CharsBuffer.