summary refs log tree commit diff
path: root/src/libstd/prelude
AgeCommit message (Collapse)AuthorLines
2015-12-17doc: fix typoTshepang Lekhonkhobe-1/+1
2015-11-12Fixup #29785Manish Goregaokar-1/+1
2015-11-11Clean up the prelude docsSteve Klabnik-96/+115
This mostly brings them in line with existing linking convention, but also has some minor re-wording. The text at the top has been re-focused, by starting out with what the prelude does, rather than starting from injecting std. Also, it now mentions that other preludes exist. Part of https://github.com/rust-lang/rust/issues/29369
2015-10-14Fix the link to `Default` trait in the prelude docsGleb Kozyrev-1/+1
2015-10-08typos: fix a grabbag of typos all over the placeCristi Cobzarenco-1/+1
2015-09-04Fix typo in prelude docsMurarth-2/+2
2015-07-30doc: prelude nitsTshepang Lekhonkhobe-3/+3
2015-07-13Address feedbackBrian Anderson-2/+2
2015-07-13std: Refining crate docsBrian Anderson-7/+96
Yet another attempt to make the prose on the std crate page clearer and more informative. This does a lot of things: tightens up the opening, adds useful links (including a link to the search bar), offers guidance on how to use the docs, and expands the prelude docs as a useful newbie entrypoint.
2015-05-13Rollup merge of #25224 - brson:stddoc, r=steveklabnikSteve Klabnik-2/+2
Attempted to organize them in a way more relevant to what newbies would be interested in hearing. I am not satisfied by this at all, but by virtue of deleting old links alone I think it is an improvement. r? @steveklabnik
2015-05-08std: Update crate docsBrian Anderson-2/+2
Attempted to organize them in a way more relevant to what newbies would be interested in hearing.
2015-05-09Squeeze the last bits of `task`s in documentation in favor of `thread`Barosl Lee-1/+1
An automated script was run against the `.rs` and `.md` files, subsituting every occurrence of `task` with `thread`. In the `.rs` files, only the texts in the comment blocks were affected.
2015-04-17std: Add Default/IntoIterator/ToOwned to the preludeAlex Crichton-4/+6
This is an implementation of [RFC 1030][rfc] which adds these traits to the prelude and additionally removes all inherent `into_iter` methods on collections in favor of the trait implementation (which is now accessible by default). [rfc]: https://github.com/rust-lang/rfcs/pull/1030 This is technically a breaking change due to the prelude additions and removal of inherent methods, but it is expected that essentially no code breaks in practice. [breaking-change] Closes #24538
2015-04-14std: Remove AsSlice/Str from the preludeAlex Crichton-3/+0
2015-03-31std: Clean out #[deprecated] APIsAlex Crichton-5/+4
This commit cleans out a large amount of deprecated APIs from the standard library and some of the facade crates as well, updating all users in the compiler and in tests as it goes along.
2015-03-31Stabilize std::numAaron Turon-3/+0
This commit stabilizes the `std::num` module: * The `Int` and `Float` traits are deprecated in favor of (1) the newly-added inherent methods and (2) the generic traits available in rust-lang/num. * The `Zero` and `One` traits are reintroduced in `std::num`, which together with various other traits allow you to recover the most common forms of generic programming. * The `FromStrRadix` trait, and associated free function, is deprecated in favor of inherent implementations. * A wide range of methods and constants for both integers and floating point numbers are now `#[stable]`, having been adjusted for integer guidelines. * `is_positive` and `is_negative` are renamed to `is_sign_positive` and `is_sign_negative`, in order to address #22985 * The `Wrapping` type is moved to `std::num` and stabilized; `WrappingOps` is deprecated in favor of inherent methods on the integer types, and direct implementation of operations on `Wrapping<X>` for each concrete integer type `X`. Closes #22985 Closes #21069 [breaking-change]
2015-03-28Remove IteratorExtSteven Fackler-1/+1
All methods are inlined into Iterator with `Self: Sized` bounds to make sure Iterator is still object safe. [breaking-change]
2015-03-23Add generic conversion traitsAaron Turon-0/+4
This commit: * Introduces `std::convert`, providing an implementation of RFC 529. * Deprecates the `AsPath`, `AsOsStr`, and `IntoBytes` traits, all in favor of the corresponding generic conversion traits. Consequently, various IO APIs now take `AsRef<Path>` rather than `AsPath`, and so on. Since the types provided by `std` implement both traits, this should cause relatively little breakage. * Deprecates many `from_foo` constructors in favor of `from`. * Changes `PathBuf::new` to take no argument (creating an empty buffer, as per convention). The previous behavior is now available as `PathBuf::from`. * De-stabilizes `IntoCow`. It's not clear whether we need this separate trait. Closes #22751 Closes #14433 [breaking-change]
2015-03-20std: Remove old_io/old_path from the preludeAlex Crichton-8/+1
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-18Register new snapshotsAlex Crichton-14/+0
2015-03-16impl<T> *const T, impl<T> *mut TJorge Aparicio-0/+1
2015-03-16impl<T> [T]Jorge Aparicio-0/+4
2015-03-16impl strJorge Aparicio-0/+4
2015-03-16impl charJorge Aparicio-0/+1
2015-03-13Deprecate range, range_step, count, distributionsAaron Turon-0/+1
This commit deprecates the `count`, `range` and `range_step` functions in `iter`, in favor of range notation. To recover all existing functionality, a new `step_by` adapter is provided directly on `ops::Range` and `ops::RangeFrom`. [breaking-change]
2015-03-03Add `core::num::wrapping` and fix overflow errors.James Miller-0/+2
Many of the core rust libraries have places that rely on integer wrapping behaviour. These places have been altered to use the wrapping_* methods: * core::hash::sip - A number of macros * core::str - The `maximal_suffix` method in `TwoWaySearcher` * rustc::util::nodemap - Implementation of FnvHash * rustc_back::sha2 - A number of macros and other places * rand::isaac - Isaac64Rng, changed to use the Wrapping helper type Some places had "benign" underflow. This is when underflow or overflow occurs, but the unspecified value is not used due to other conditions. * collections::bit::Bitv - underflow when `self.nbits` is zero. * collections::hash::{map,table} - Underflow when searching an empty table. Did cause undefined behaviour in this case due to an out-of-bounds ptr::offset based on the underflowed index. However the resulting pointers would never be read from. * syntax::ext::deriving::encodable - Underflow when calculating the index of the last field in a variant with no fields. These cases were altered to avoid the underflow, often by moving the underflowing operation to a place where underflow could not happen. There was one case that relied on the fact that unsigned arithmetic and two's complement arithmetic are identical with wrapping semantics. This was changed to use the wrapping_* methods. Finally, the calculation of variant discriminants could overflow if the preceeding discriminant was `U64_MAX`. The logic in `rustc::middle::ty` for this was altered to avoid the overflow completely, while the remaining places were changed to use wrapping methods. This is because `rustc::middle::ty::enum_variants` now throws an error when the calculated discriminant value overflows a `u64`. This behaviour can be triggered by the following code: ``` enum Foo { A = U64_MAX, B } ``` This commit also implements the remaining integer operators for Wrapped<T>.
2015-02-24std::prelude: code consistency nitsTshepang Lekhonkhobe-4/+1
2015-02-03Rename std::path to std::old_pathAaron Turon-1/+1
As part of [RFC 474](https://github.com/rust-lang/rfcs/pull/474), this commit renames `std::path` to `std::old_path`, leaving the existing path API in place to ease migration to the new one. Updating should be as simple as adjusting imports, and the prelude still maps to the old path APIs for now. [breaking-change]
2015-02-02register snapshotsJorge Aparicio-4/+0
2015-01-30Rename FullRange to RangeFullNick Cameron-1/+1
2015-01-27Merge remote-tracking branch 'rust-lang/master'Brian Anderson-1/+1
Conflicts: src/libcore/cell.rs src/librustc_driver/test.rs src/libstd/old_io/net/tcp.rs src/libstd/old_io/process.rs
2015-01-26Fallout of io => old_ioAlex Crichton-1/+1
2015-01-23grandfathered -> rust1Brian Anderson-20/+20
2015-01-23Deprecated attributes don't take 'feature' names and are paired with ↵Brian Anderson-1/+0
stable/unstable Conflicts: src/libcore/atomic.rs src/libcore/finally.rs src/test/auxiliary/inherited_stability.rs src/test/auxiliary/lint_stability.rs
2015-01-23Set unstable feature names appropriatelyBrian Anderson-1/+1
* `core` - for the core crate * `hash` - hashing * `io` - io * `path` - path * `alloc` - alloc crate * `rand` - rand crate * `collections` - collections crate * `std_misc` - other parts of std * `test` - test crate * `rustc_private` - everything else
2015-01-21Remove 'since' from unstable attributesBrian Anderson-1/+1
2015-01-21Add 'feature' and 'since' to stability attributesBrian Anderson-22/+41
2015-01-07use slicing sugarJorge Aparicio-1/+1
2015-01-06Test fixes and rebase conflictsAlex Crichton-1/+4
2015-01-06rollup merge of #20607: nrc/kindsAlex Crichton-2/+1
Conflicts: src/libcore/array.rs src/libcore/cell.rs src/libcore/prelude.rs src/libstd/path/posix.rs src/libstd/prelude/v1.rs src/test/compile-fail/dst-sized-trait-param.rs
2015-01-07markers -> markerNick Cameron-1/+1
2015-01-07falloutNick Cameron-1/+2
2015-01-07Change `std::kinds` to `std::markers`; flatten `std::kinds::marker`Nick Cameron-1/+1
[breaking-change]
2015-01-05rollup merge of #20565: alexcrichton/missing-stabilityAlex Crichton-0/+2
Conflicts: src/libstd/sync/mpsc/mod.rs
2015-01-05Stabilization of impls and fallout from stabilizationAaron Turon-2/+0
2015-01-04std: Fix missing stability on preludeAlex Crichton-0/+2
The module itself is stable (the name)
2015-01-05Merge `UnicodeChar` and `CharExt`.Huon Wilson-1/+1
This "reexports" all the functionality of `core::char::CharExt` as methods on `unicode::u_char::UnicodeChar` (renamed to `CharExt`). Imports may need to be updated (one now just imports `unicode::CharExt`, or `std::char::CharExt` rather than two traits from either), so this is a [breaking-change]
2015-01-05Rename `core::char::Char` to `CharExt` to match prelude guidelines.Huon Wilson-1/+1
Imports may need to be updated so this is a [breaking-change]
2015-01-03sed -i -s 's/\bmod,/self,/g' **/*.rsJorge Aparicio-2/+2
2015-01-03core: merge IteratorPairExt into IteratorExtJorge Aparicio-1/+0