about summary refs log tree commit diff
path: root/src/libstd/prelude.rs
AgeCommit message (Collapse)AuthorLines
2014-06-30libstd: set baseline stability levels.Aaron Turon-0/+2
Earlier commits have established a baseline of `experimental` stability for all crates under the facade (so their contents are considered experimental within libstd). Since `experimental` is `allow` by default, we should use the same baseline stability for libstd itself. This commit adds `experimental` tags to all of the modules defined in `std`, and `unstable` to `std` itself.
2014-06-14rustc: Obsolete the `@` syntax entirelyAlex Crichton-4/+0
This removes all remnants of `@` pointers from rustc. Additionally, this removes the `GC` structure from the prelude as it seems odd exporting an experimental type in the prelude by default. Closes #14193 [breaking-change]
2014-06-11rustc: Remove ~[T] from the languageAlex Crichton-1/+1
The following features have been removed * box [a, b, c] * ~[a, b, c] * box [a, ..N] * ~[a, ..N] * ~[T] (as a type) * deprecated_owned_vector lint All users of ~[T] should move to using Vec<T> instead.
2014-06-10Pub use CheckedDiv in the preludeAdolfo Ochagavía-1/+1
2014-06-09core: Move the collections traits to libcollectionsAlex Crichton-2/+2
This commit moves Mutable, Map, MutableMap, Set, and MutableSet from `core::collections` to the `collections` crate at the top-level. Additionally, this removes the `deque` module and moves the `Deque` trait to only being available at the top-level of the collections crate. All functionality continues to be reexported through `std::collections`. [breaking-change]
2014-06-03std: Remove generics from Option::expectAlex Crichton-1/+0
This commit removes the <M: Any + Send> type parameter from Option::expect in favor of just taking a hard-coded `&str` argument. This allows this function to move into libcore. Previous code using strings with `expect` will continue to work, but code using this implicitly to transmit task failure will need to unwrap manually with a `match` statement. [breaking-change] Closes #14008
2014-06-01std: Drop Total from Total{Eq,Ord}Alex Crichton-3/+3
This completes the last stage of the renaming of the comparison hierarchy of traits. This change renames TotalEq to Eq and TotalOrd to Ord. In the future the new Eq/Ord will be filled out with their appropriate methods, but for now this change is purely a renaming change. [breaking-change]
2014-05-30std: Rename {Eq,Ord} to Partial{Eq,Ord}Alex Crichton-1/+1
This is part of the ongoing renaming of the equality traits. See #12517 for more details. All code using Eq/Ord will temporarily need to move to Partial{Eq,Ord} or the Total{Eq,Ord} traits. The Total traits will soon be renamed to {Eq,Ord}. cc #12517 [breaking-change]
2014-05-25rustdoc: Move inlining to its own moduleAlex Crichton-49/+49
2014-05-25std: Add doc(noinline) to the prelude reexportsAlex Crichton-42/+49
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-1/+1
[breaking-change]
2014-05-20Add slice::MutableCloneableVector to the preludeKevin Ballard-4/+4
Every other trait in slice is in the prelude, so it makes sense to provide MutableCloneableVector as well.
2014-05-15core: Implement unwrap()/unwrap_err() on ResultAlex Crichton-2/+1
Now that std::fmt is in libcore, it's possible to implement this as an inherit method rather than through extension traits. This commit also tweaks the failure interface of libcore to libstd to what it should be, one method taking &fmt::Arguments
2014-05-07core: Move Option::expect to libstd from libcoreAlex Crichton-0/+1
See #14008 for more details
2014-05-07core: Add unwrap()/unwrap_err() methods to ResultAlex Crichton-0/+1
These implementations must live in libstd right now because the fmt module has not been migrated yet. This will occur in a later PR. Just to be clear, there are new extension traits, but they are not necessary once the std::fmt module has migrated to libcore, which is a planned migration in the future.
2014-05-07core: Inherit possible string functionalityAlex Crichton-0/+1
This moves as much allocation as possible from teh std::str module into core::str. This includes essentially all non-allocating functionality, mostly iterators and slicing and such. This primarily splits the Str trait into only having the as_slice() method, adding a new StrAllocating trait to std::str which contains the relevant new allocation methods. This is a breaking change if any of the methods of "trait Str" were overriden. The old functionality can be restored by implementing both the Str and StrAllocating traits. [breaking-change]
2014-05-07core: Inherit non-allocating slice functionalityAlex Crichton-1/+1
This commit adds a new trait, MutableVectorAllocating, which represents functions on vectors which can allocate. This is another extension trait to slices which should be removed once a lang item exists for the ~ allocation.
2014-05-06librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, exceptPatrick Walton-0/+1
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
2014-04-30rustdoc: fix overly broad selectorsAdrien Tétar-1/+1
2014-04-29auto merge of #13772 : brson/rust/cratedocs, r=alexcrichtonbors-10/+28
Also move prelude explanation to the prelude module. This tries to provide a guide to what's in the standard library, organized bottom up from primitives to I/O.
2014-04-27std: Rewrite crate docsBrian Anderson-10/+28
Also move prelude explanation to the prelude module.
2014-04-19Merge the Round trait into the Float traitBrendan Zabarauskas-1/+1
Move the rounding functions into the `std::num::Float` trait and then remove `std::num::Round`. This continues the flattening of the numeric traits tracked in #10387. The aim is to make `std::num` very simple and tied to the built in types, leaving the definition of more complex numeric towers to third-party libraries. [breaking-change]
2014-04-18std: Make ~[T] no longer a growable vectorAlex Crichton-1/+1
This removes all resizability support for ~[T] vectors in preparation of DST. The only growable vector remaining is Vec<T>. In summary, the following methods from ~[T] and various functions were removed. Each method/function has an equivalent on the Vec type in std::vec unless otherwise stated. * slice::OwnedCloneableVector * slice::OwnedEqVector * slice::append * slice::append_one * slice::build (no replacement) * slice::bytes::push_bytes * slice::from_elem * slice::from_fn * slice::with_capacity * ~[T].capacity() * ~[T].clear() * ~[T].dedup() * ~[T].extend() * ~[T].grow() * ~[T].grow_fn() * ~[T].grow_set() * ~[T].insert() * ~[T].pop() * ~[T].push() * ~[T].push_all() * ~[T].push_all_move() * ~[T].remove() * ~[T].reserve() * ~[T].reserve_additional() * ~[T].reserve_exect() * ~[T].retain() * ~[T].set_len() * ~[T].shift() * ~[T].shrink_to_fit() * ~[T].swap_remove() * ~[T].truncate() * ~[T].unshift() * ~str.clear() * ~str.set_len() * ~str.truncate() Note that no other API changes were made. Existing apis that took or returned ~[T] continue to do so. [breaking-change]
2014-04-10libstd: Implement `StrBuf`, a new string buffer type like `Vec`, andPatrick Walton-0/+1
port all code over to use it.
2014-03-28Rename Pod into CopyFlavio Percoco-1/+1
Summary: So far, we've used the term POD "Plain Old Data" to refer to types that can be safely copied. However, this term is not consistent with the other built-in bounds that use verbs instead. This patch renames the Pod kind into Copy. RFC: 0003-opt-in-builtin-traits Test Plan: make check Reviewers: cmr Differential Revision: http://phabricator.octayn.net/D3
2014-03-24comm: Implement synchronous channelsAlex Crichton-1/+1
This commit contains an implementation of synchronous, bounded channels for Rust. This is an implementation of the proposal made last January [1]. These channels are built on mutexes, and currently focus on a working implementation rather than speed. Receivers for sync channels have select() implemented for them, but there is currently no implementation of select() for sync senders. Rust will continue to provide both synchronous and asynchronous channels as part of the standard distribution, there is no intent to remove asynchronous channels. This flavor of channels is meant to provide an alternative to asynchronous channels because like green tasks, asynchronous channels are not appropriate for all situations. [1] - https://mail.mozilla.org/pipermail/rust-dev/2014-January/007924.html
2014-03-22std: Remove the Freeze kind and the NoFreeze markerFlavio Percoco-1/+1
2014-03-20std: Add Vec to the preludeAlex Crichton-0/+1
This is an incredibly common type, and it is expected to be used in many many places. This type should be in the prelude.
2014-03-20Add a Share kindFlavio Percoco-1/+1
Fixes #11781
2014-03-20rename std::vec -> std::sliceDaniel Micay-4/+4
Closes #12702
2014-03-13std: Rename Chan/Port types and constructorAlex Crichton-1/+1
* Chan<T> => Sender<T> * Port<T> => Receiver<T> * Chan::new() => channel() * constructor returns (Sender, Receiver) instead of (Receiver, Sender) * local variables named `port` renamed to `rx` * local variables named `chan` renamed to `tx` Closes #11765
2014-03-08Removed DeepClone. Issue #12698.Michael Darakananda-1/+1
2014-03-04auto merge of #12491 : eddyb/rust/deref, r=nikomatsakisbors-1/+1
Add the `Deref` and `DerefMut` traits and implement overloading explicit dereferences.
2014-03-04Cleaned up `std::any`Marvin Löbel-1/+0
- Added `TraitObject` representation to `std::raw`. - Added doc to `std::raw`. - Removed `Any::as_void_ptr()` and `Any::as_mut_void_ptr()` methods as they are uneccessary now after the removal of headers on owned boxes. This reduces the number of virtual calls needed. - Made the `..Ext` implementations work directly with the repr of a trait object. - Removed `Any`-related traits from the prelude. - Added bench for `Any`
2014-03-04Add the DerefImm and DerefMut traits.Eduard Burtescu-1/+1
2014-02-25Remove std::bool::{Bool, all_values}Brendan Zabarauskas-1/+0
These were never used outside of the tests
2014-02-24Remove std::num::ToStrRadix from the preludeBrendan Zabarauskas-1/+1
2014-02-24Remove std::from_str::FromStr from the preludeBrendan Zabarauskas-1/+0
2014-02-24Remove std::default::Default from the preludeBrendan Zabarauskas-1/+0
2014-02-24Transition to new `Hash`, removing IterBytes and std::to_bytes.Huon Wilson-1/+0
2014-02-21std: rewrite Hash to make it more genericErick Tryzelaar-1/+0
This patch merges IterBytes and Hash traits, which clears up the confusion of using `#[deriving(IterBytes)]` to support hashing. Instead, it now is much easier to use the new `#[deriving(Hash)]` for making a type hashable with a stream hash. Furthermore, it supports custom non-stream-based hashers, such as if a value's hash was cached in a database. This does not yet replace the old IterBytes-hash with this new version.
2014-02-21std: minor whitespace cleanupErick Tryzelaar-1/+1
2014-02-22Move std::num::Integer to libnumBrendan Zabarauskas-1/+1
2014-02-19Update comments in the preludePalmer Cox-11/+2
The comments say that the prelude imports std::io::println since it would be annoying to have to import it in every program that uses it. However, the prelude doesn't actually import that function anymore. So, update the comments to better match reality.
2014-02-17auto merge of #12321 : bjz/rust/remove-real, r=alexcrichtonbors-1/+1
This is part of the effort to simplify `std::num`, as tracked in issue #10387. It is also a step towards a proper IEEE-754 trait (see #12281).
2014-02-17Remove Real trait and move methods into FloatBrendan Zabarauskas-1/+1
This is part of the effort to simplify `std::num`, as tracked in issue #10387.
2014-02-17Remove CloneableTuple and ImmutableTuple traitsBrendan Zabarauskas-1/+0
These are adequately covered by the Tuple2 trait.
2014-02-16Merge ImmutableTuple* traits into their respective Tuple* traitBrendan Zabarauskas-3/+0
2014-02-13Removed num::OrderableMichael Darakananda-1/+1
2014-02-11Rewrite channels yet again for upgradeabilityAlex Crichton-1/+1
This, the Nth rewrite of channels, is not a rewrite of the core logic behind channels, but rather their API usage. In the past, we had the distinction between oneshot, stream, and shared channels, but the most recent rewrite dropped oneshots in favor of streams and shared channels. This distinction of stream vs shared has shown that it's not quite what we'd like either, and this moves the `std::comm` module in the direction of "one channel to rule them all". There now remains only one Chan and one Port. This new channel is actually a hybrid oneshot/stream/shared channel under the hood in order to optimize for the use cases in question. Additionally, this also reduces the cognitive burden of having to choose between a Chan or a SharedChan in an API. My simple benchmarks show no reduction in efficiency over the existing channels today, and a 3x improvement in the oneshot case. I sadly don't have a pre-last-rewrite compiler to test out the old old oneshots, but I would imagine that the performance is comparable, but slightly slower (due to atomic reference counting). This commit also brings the bonus bugfix to channels that the pending queue of messages are all dropped when a Port disappears rather then when both the Port and the Chan disappear.