summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2014-05-30lib{std,core,debug,rustuv,collections,native,regex}: Fix snake_case errors.Kevin Butler-28/+19
A number of functions/methods have been moved or renamed to align better with rust standard conventions. std::reflect::MovePtrAdaptor => MovePtrAdaptor::new debug::reflect::MovePtrAdaptor => MovePtrAdaptor::new std::repr::ReprVisitor => ReprVisitor::new debug::repr::ReprVisitor => ReprVisitor::new rustuv::homing::HomingIO.go_to_IO_home => go_to_io_home [breaking-change]
2014-05-30Rename OSRng to OsRngPiotr Jawniak-25/+25
According to Rust's style guide acronyms in type names should be CamelCase. [breaking-change]
2014-05-29auto merge of #14510 : kballard/rust/rename_strallocating_into_owned, ↵bors-21/+16
r=alexcrichton We already have into_string(), but it was implemented in terms of into_owned(). Flip it around and deprecate into_owned(). Remove a few spurious calls to .into_owned() that existed in libregex and librustdoc.
2014-05-29std: Recreate a `rand` moduleAlex Crichton-25/+925
This commit shuffles around some of the `rand` code, along with some reorganization. The new state of the world is as follows: * The librand crate now only depends on libcore. This interface is experimental. * The standard library has a new module, `std::rand`. This interface will eventually become stable. Unfortunately, this entailed more of a breaking change than just shuffling some names around. The following breaking changes were made to the rand library: * Rng::gen_vec() was removed. This has been replaced with Rng::gen_iter() which will return an infinite stream of random values. Previous behavior can be regained with `rng.gen_iter().take(n).collect()` * Rng::gen_ascii_str() was removed. This has been replaced with Rng::gen_ascii_chars() which will return an infinite stream of random ascii characters. Similarly to gen_iter(), previous behavior can be emulated with `rng.gen_ascii_chars().take(n).collect()` * {IsaacRng, Isaac64Rng, XorShiftRng}::new() have all been removed. These all relied on being able to use an OSRng for seeding, but this is no longer available in librand (where these types are defined). To retain the same functionality, these types now implement the `Rand` trait so they can be generated with a random seed from another random number generator. This allows the stdlib to use an OSRng to create seeded instances of these RNGs. * Rand implementations for `Box<T>` and `@T` were removed. These seemed to be pretty rare in the codebase, and it allows for librand to not depend on liballoc. Additionally, other pointer types like Rc<T> and Arc<T> were not supported. If this is undesirable, librand can depend on liballoc and regain these implementations. * The WeightedChoice structure is no longer built with a `Vec<Weighted<T>>`, but rather a `&mut [Weighted<T>]`. This means that the WeightedChoice structure now has a lifetime associated with it. * The `sample` method on `Rng` has been moved to a top-level function in the `rand` module due to its dependence on `Vec`. cc #13851 [breaking-change]
2014-05-29auto merge of #14481 : alexcrichton/rust/no-format-strbuf, r=sfacklerbors-39/+23
* Removes `format_strbuf!()`
2014-05-28Replace StrAllocating.into_owned() with .into_string()Kevin Ballard-21/+16
We already have into_string(), but it was implemented in terms of into_owned(). Flip it around and deprecate into_owned(). Remove a few spurious calls to .into_owned() that existed in libregex and librustdoc.
2014-05-28auto merge of #14437 : Sawyer47/rust/utf16-items, r=alexcrichtonbors-2/+2
According to Rust's style guide acronyms should be CamelCase.
2014-05-28std: Remove format_strbuf!()Alex Crichton-39/+23
This was only ever a transitionary macro.
2014-05-28auto merge of #14459 : seanmonstar/rust/select-docs, r=alexcrichtonbors-3/+3
2014-05-28Rename UTF16Item[s] to Utf16Item[s]Piotr Jawniak-2/+2
According to Rust's style guide acronyms should be CamelCase. [breaking-change]
2014-05-27Move std::{reflect,repr,Poly} to a libdebug crateAlex Crichton-19/+32
This commit moves reflection (as well as the {:?} format modifier) to a new libdebug crate, all of which is marked experimental. This is a breaking change because it now requires the debug crate to be explicitly linked if the :? format qualifier is used. This means that any code using this feature will have to add `extern crate debug;` to the top of the crate. Any code relying on reflection will also need to do this. Closes #12019 [breaking-change]
2014-05-27auto merge of #14414 : richo/rust/features/nerf_unused_string_fns, ↵bors-302/+306
r=alexcrichton This should block on #14323
2014-05-27doc: Fix link to stringRicho Healey-1/+1
This was missed in 553074506ecd139eb961fb91eb33ad9fd0183acb
2014-05-27std: Rename strbuf operations to stringRicho Healey-187/+187
[breaking-change]
2014-05-27std: Remove String's to_ownedRicho Healey-109/+113
2014-05-27std: change select! docs from 'ports' to 'receivers'Sean McArthur-3/+3
2014-05-26std: Remove String::from_owned_str as it's redundantRicho Healey-5/+5
[breaking-change]
2014-05-26Minor fixes to `std::str` docsP1start-11/+12
This tweaks the `std::str` docs to compensate for the recent shift from `~str` to `String`.
2014-05-25auto merge of #14430 : kballard/rust/squelch_os_warning, r=alexcrichtonbors-70/+27
Clean up the re-exports of various modules in `std::std`, and remove the `realstd` stuff from `std::rt::args`.
2014-05-25De-realstd os::argsKevin Ballard-48/+8
With the test runner using ::std::os::args(), and std::std::os now being a re-export of realstd::os, there's no more need for realstd stuff mucking up rt::args. Remove the one test of os::args(), as it's not very useful and it won't work anymore now that rt::args doesn't use realstd.
2014-05-25libstd: Remove unnecessary re-exports under std::stdKevin Ballard-22/+19
2014-05-25auto merge of #14391 : alexcrichton/rust/more-rustdoc-inline, r=huonwbors-48/+55
As part of the libstd facade (cc #13851), rustdoc is taught to inline documentation across crate boundaries through the usage of a `pub use` statement. This is done to allow libstd to maintain the facade that it is a standalone library with a defined public interface (allowing us to shuffle around what's underneath it). A preview is available at http://people.mozilla.org/~acrichton/doc/std/index.html
2014-05-25rustdoc: Move inlining to its own moduleAlex Crichton-55/+55
2014-05-25std: Add doc(noinline) to the prelude reexportsAlex Crichton-42/+49
2014-05-25auto merge of #14415 : Sawyer47/rust/ascii-fixme, r=huonwbors-5/+2
Issue #5475 was closed some time ago, but ascii.rs still contained a FIXME for it.
2014-05-25Fix FIXME #5475 in std::asciiPiotr Jawniak-5/+2
Issue #5475 was closed some time ago, but ascii.rs still contained a FIXME for it.
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-286/+286
[breaking-change]
2014-05-24auto merge of #14402 : huonw/rust/arc-field-rename, r=alexcrichtonbors-7/+9
Paper over privacy issues with Deref by changing field names. Types that implement Deref can cause weird error messages due to their private fields conflicting with a field of the type they deref to, e.g., previously struct Foo { x: int } let a: Arc<Foo> = ...; println!("{}", a.x); would complain the the `x` field of `Arc` was private (since Arc has a private field called `x`) rather than just ignoring it. This patch doesn't fix that issue, but does mean one would have to write `a._ptr` to hit the same error message, which seems far less common. (This patch `_`-prefixes all private fields of `Deref`-implementing types.) cc #12808
2014-05-25Paper over privacy issues with Deref by changing field names.Huon Wilson-7/+9
Types that implement Deref can cause weird error messages due to their private fields conflicting with a field of the type they deref to, e.g., previously struct Foo { x: int } let a: Arc<Foo> = ...; println!("{}", a.x); would complain the the `x` field of `Arc` was private (since Arc has a private field called `x`) rather than just ignoring it. This patch doesn't fix that issue, but does mean one would have to write `a._ptr` to hit the same error message, which seems far less common. (This patch `_`-prefixes all private fields of `Deref`-implementing types.) cc #12808
2014-05-24auto merge of #14401 : aochagavia/rust/pr4, r=alexcrichtonbors-6/+48
Some functions implemented for the Ascii struct have the same functionality as other functions implemented for the normal chars. For consistency, I think they should have the same name, so I renamed the functions in Ascii to match the names in the Char trait. * Renamed `to_lower` to `to_lowercase` * Renamed `to_upper` to `to_uppercase` * Renamed `is_alpha` to `is_alphabetic` * Renamed `is_alnum` to `is_alphanumeric` * Renamed `is_lower` to `is_lowercase` * Renamed `is_upper` to `is_uppercase` [breaking-change]
2014-05-24auto merge of #14378 : huonw/rust/deque-adjustments, r=alexcrichtonbors-5/+5
Might as well remove the duplication/`forget` call.
2014-05-24auto merge of #14396 : vhbit/rust/opaque-mutex, r=alexcrichtonbors-23/+31
On some systems (iOS for example) mutex is represented by opaque data structure which doesn't play well with simple data copy. Therefore mutex should be initialized from magic static value and filled by OS only when it landed RC. Initially written for iOS but since landing iOS support might require quite a lot of time I think it is better to split parts which aren't directly related to iOS and merge them in
2014-05-24std: minor simplification to sync::deque.Huon Wilson-5/+5
2014-05-24Rename functions in AsciiAdolfo Ochagavía-6/+48
Some functions implemented for the Ascii struct have the same functionality as other functions implemented for the normal chars. For consistency, I think they should have the same name, so I renamed the functions in Ascii to match the names in the Char trait. * Renamed `to_lower` to `to_lowercase` * Renamed `to_upper` to `to_uppercase` * Renamed `is_alpha` to `is_alphabetic` * Renamed `is_alnum` to `is_alphanumeric` * Renamed `is_lower` to `is_lowercase` * Renamed `is_upper` to `is_uppercase` [breaking-change]
2014-05-24auto merge of #14392 : alexcrichton/rust/mem-updates, r=sfacklerbors-5/+5
* All of the *_val functions have gone from #[unstable] to #[stable] * The overwrite and zeroed functions have gone from #[unstable] to #[stable] * The uninit function is now deprecated, replaced by its stable counterpart, uninitialized [breaking-change]
2014-05-24Fixes problems on systems with opaque mutexValerii Hiora-23/+31
On some systems (iOS for example) mutex is represented by opaque data structure which doesn't play well with simple data copy. Therefore mutex should be initialized from magic static value and filled by OS only when it landed RC.
2014-05-23core: Finish stabilizing the `mem` module.Alex Crichton-5/+5
* All of the *_val functions have gone from #[unstable] to #[stable] * The overwrite and zeroed functions have gone from #[unstable] to #[stable] * The uninit function is now deprecated, replaced by its stable counterpart, uninitialized [breaking-change]
2014-05-23auto merge of #14379 : brson/rust/simd, r=alexcrichtonbors-83/+24
Followup to https://github.com/mozilla/rust/pull/14331 and https://github.com/mozilla/rust/pull/12524
2014-05-23std: Move unstable::finally to std::finally. #1457Brian Anderson-5/+4
[breaking-change]
2014-05-23std: Move simd to core::simd and reexport. #1457Brian Anderson-63/+2
[breaking-change]
2014-05-23std: Move running_on_valgrind to rt::util. #1457Brian Anderson-15/+18
[breaking-change]
2014-05-23auto merge of #14368 : tedhorst/rust/master, r=alexcrichtonbors-1/+1
2014-05-23auto merge of #14359 : brson/rust/minordoc, r=alexcrichtonbors-2/+1
2014-05-23Minor library doc copyeditingBrian Anderson-2/+1
2014-05-23auto merge of #14360 : alexcrichton/rust/remove-deprecated, r=kballardbors-74/+5
These have all been deprecated for awhile now, so it's likely time to start removing them.
2014-05-22updated hash value in reduced benchmarkTed Horst-1/+1
2014-05-22auto merge of #14357 : huonw/rust/spelling, r=pnkfelixbors-7/+7
The span on a inner doc-comment would point to the next token, e.g. the span for the `a` line points to the `b` line, and the span of `b` points to the `fn`. ```rust //! a //! b fn bar() {} ```
2014-05-22auto merge of #14314 : alexcrichton/rust/deriving-hash, r=brsonbors-1/+2
One of the long-term goals of the libstd facade is to move the collections library underneath the standard library. This would imply that libcollections today would invert its dependency with libstd. One of the primary blockers for doing this is the HashMap collection. Of its two major dependencies, hashing and randomness, this commit is the first step in dealing with hashing. When moving the hash module beneath libstd, it must break its primary dependence on the io::Writer trait (used as the hashing state). The proposed strategy for breaking this dependence is taking a similar path as core::fmt, which is to have the hash module define its own "writer trait". This trait would be similar to std::io::Writer, except that it would not return errors and it would have fewer convenience methods. The Hash trait today has its type parameter behind a feature gate (default type parameters), so this pending change will likely break no code which hasn't opted in to the feature gate. The SipState struct will lose its implementation of io::Writer, but it will regain similar methods for dealing with writing data. This change specifically prepares for the hash migration by modifying deriving(Hash) to use the std::hash::Writer bound instead of the std::io::Writer bound. This bound is currently wired to std::io::Writer, but after a snapshot it will have no need to be wired to the io writer trait.
2014-05-22auto merge of #14348 : alexcrichton/rust/doc.rust-lang.org, r=huonwbors-2/+2
2014-05-22libcore: Remove all uses of `~str` from `libcore`.Patrick Walton-137/+148
[breaking-change]