summary refs log tree commit diff
path: root/src/libcore/prelude.rs
AgeCommit message (Collapse)AuthorLines
2014-10-07Rename slicing methodsNick Cameron-0/+1
2014-10-07Rename slice::SliceNick Cameron-2/+1
2014-08-13core: Rename ImmutableEqSlice to ImmutablePartialEqSliceBrian Anderson-1/+1
This is in the prelude and won't break much code. [breaking-change]
2014-08-13std: Rename slice::Vector to SliceBrian Anderson-1/+1
This required some contortions because importing both raw::Slice and slice::Slice makes rustc crash. Since `Slice` is in the prelude, this renaming is unlikely to casue breakage. [breaking-change]
2014-08-13std: Rename various slice traits for consistencyBrian Anderson-3/+3
ImmutableVector -> ImmutableSlice ImmutableEqVector -> ImmutableEqSlice ImmutableOrdVector -> ImmutableOrdSlice MutableVector -> MutableSlice MutableVectorAllocating -> MutableSliceAllocating MutableCloneableVector -> MutableCloneableSlice MutableOrdVector -> MutableOrdSlice These are all in the prelude so most code will not break. [breaking-change]
2014-08-07Rename `Share` to `Sync`Alex Crichton-1/+1
This leaves the `Share` trait at `std::kinds` via a `#[deprecated]` `pub use` statement, but the `NoShare` struct is no longer part of `std::kinds::marker` due to #12660 (the build cannot bootstrap otherwise). All code referencing the `Share` trait should now reference the `Sync` trait, and all code referencing the `NoShare` type should now reference the `NoSync` type. The functionality and meaning of this trait have not changed, only the naming. Closes #16281 [breaking-change]
2014-07-18librustc: Implement unboxed closures with mutable receiversPatrick Walton-0/+1
2014-07-09Register new snapshotsAlex Crichton-1/+0
Closes #15544
2014-07-07librustc (RFC #34): Implement the new `Index` and `IndexMut` traits.Patrick Walton-1/+3
This will break code that used the old `Index` trait. Change this code to use the new `Index` traits. For reference, here are their signatures: pub trait Index<Index,Result> { fn index<'a>(&'a self, index: &Index) -> &'a Result; } pub trait IndexMut<Index,Result> { fn index_mut<'a>(&'a mut self, index: &Index) -> &'a mut Result; } Closes #6515. [breaking-change]
2014-06-08core: Rename `container` mod to `collections`. Closes #12543Brian Anderson-1/+1
Also renames the `Container` trait to `Collection`. [breaking-change]
2014-06-01std: Drop Total from Total{Eq,Ord}Alex Crichton-2/+2
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/+2
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-17core: Clarify the documentation on core's preludeAlex Crichton-1/+17
Closes #14246
2014-05-15Updates with core::fmt changesAlex Crichton-1/+1
1. Wherever the `buf` field of a `Formatter` was used, the `Formatter` is used instead. 2. The usage of `write_fmt` is minimized as much as possible, the `write!` macro is preferred wherever possible. 3. Usage of `fmt::write` is minimized, favoring the `write!` macro instead.
2014-05-07core: Get coretest workingAlex Crichton-0/+47
This mostly involved frobbing imports between realstd, realcore, and the core being test. Some of the imports are a little counterintuitive, but it mainly focuses around libcore's types not implementing Show while libstd's types implement Show.
2013-05-22libstd: Rename libcore to libstd and libstd to libextra; update makefiles.Patrick Walton-111/+0
This only changes the directory names; it does not change the "real" metadata names.
2013-05-19auto merge of #6595 : bjz/rust/core-tuple, r=thestingerbors-2/+6
2013-05-19Create Char traitBrendan Zabarauskas-0/+1
2013-05-19Replace Tuple{2..12} trait with CloneableTuple{2..12} and ImmutableTuple{2..12}Brendan Zabarauskas-2/+6
Make n{0..11} methods return cloned values, and create n{0..12}_ref methods for returning references
2013-05-18Create tuple element accessor traitsBrendan Zabarauskas-0/+2
2013-05-15add a DeepClone traitDaniel Micay-1/+1
for deep copies through shared ownership boundaries
2013-05-10Move core::task::local_data to core::local_dataYoungsoo Son-0/+1
2013-05-07Remove Durable from the languageBrian Anderson-1/+1
2013-05-06Move FuzzyEq trait into core::cmp and rename it to 'ApproxEq'Brendan Zabarauskas-1/+1
2013-05-04Register snapshotsBrian Anderson-3/+0
2013-05-03auto merge of #6216 : Sodel-the-Vociferous/rust/dralston-6146, r=graydonbors-1/+1
cc #6146
2013-05-03Add core::cmp::Equiv to preludeDaniel Ralston-1/+1
2013-05-02libcore: Export core::from_str::FromStr from core::preludegifnksm-0/+1
2013-05-01Revert rename of Div to QuotBrendan Zabarauskas-1/+1
2013-04-29auto merge of #6110 : bjz/rust/numeric-traits, r=pcwaltonbors-2/+3
As discussed on issue #4819, I have created four new traits: `Algebraic`, `Trigonometric`, `Exponential` and `Hyperbolic`, and moved the appropriate methods into them from `Real`. ~~~rust pub trait Algebraic { fn pow(&self, n: Self) -> Self; fn sqrt(&self) -> Self; fn rsqrt(&self) -> Self; fn cbrt(&self) -> Self; fn hypot(&self, other: Self) -> Self; } pub trait Trigonometric { fn sin(&self) -> Self; fn cos(&self) -> Self; fn tan(&self) -> Self; fn asin(&self) -> Self; fn acos(&self) -> Self; fn atan(&self) -> Self; fn atan2(&self, other: Self) -> Self; } pub trait Exponential { fn exp(&self) -> Self; fn exp2(&self) -> Self; fn expm1(&self) -> Self; fn log(&self) -> Self; fn log2(&self) -> Self; fn log10(&self) -> Self; } pub trait Hyperbolic: Exponential { fn sinh(&self) -> Self; fn cosh(&self) -> Self; fn tanh(&self) -> Self; } ~~~ There was some discussion over whether we should shorten the names, for example `Trig` and `Exp`. No abbreviations have been agreed on yet, but this could be considered in the future. Additionally, `Integer::divisible_by` has been renamed to `Integer::is_multiple_of`.
2013-04-29Revert "Merge Exponential and Hyperbolic traits"Brendan Zabarauskas-1/+1
After discussions on IRC and #4819, we have decided to revert this change. This is due to the traits expressing different ideas and because hyperbolic functions are not trivially implementable from exponential functions for floating-point types.
2013-04-29Merge Exponential and Hyperbolic traitsBrendan Zabarauskas-1/+1
The Hyperbolic Functions are trivially implemented in terms of `exp`, so it's simpler to group them the Exponential trait. In the future these would have default implementations.
2013-04-29Move appropriate functions out of Real and into separate Algebraic, ↵Brendan Zabarauskas-2/+3
Trigonometric, Exponential and Hyperbolic traits
2013-04-28make way for a new iter moduleDaniel Micay-3/+5
2013-04-27Add Orderable traitBrendan Zabarauskas-1/+1
This is a temporary trait until we have default methods. We don't want to encumber all implementors of Ord by requiring them to implement these functions, but at the same time we want to be able to take advantage of the speed of the specific numeric functions (like the `fmin` and `fmax` intrinsics).
2013-04-26Combine PrimitiveInt, Int, and Uint traits into one single traitBrendan Zabarauskas-2/+1
Having three traits for primitive ints/uints seemed rather excessive. If users wish to specify between them they can simply combine Int with either the Signed and Unsigned traits. For example: fn foo<T: Int + Signed>() { … }
2013-04-26Add BitCount traitBrendan Zabarauskas-1/+1
2013-04-26Add Int, Uint and Float traits for primitive numbersBrendan Zabarauskas-0/+1
2013-04-26Add Bitwise, Bounded, Primitive, and PrimitiveInt traitsBrendan Zabarauskas-0/+2
2013-04-25Restore Round trait and move appropriate methods out of RealBrendan Zabarauskas-1/+1
2013-04-25Add Fractional, Real and RealExt traitsBrendan Zabarauskas-0/+1
2013-04-25Rename Natural to IntegerBrendan Zabarauskas-1/+2
'Natural' normally means 'positive integer' in mathematics. It is therefore strange to implement it on signed integer types. 'Integer' is probably a better choice.
2013-04-25Use #[cfg(not(stage0))] to exclude items from stage0Brendan Zabarauskas-3/+1
As requested on the mailing list: https://mail.mozilla.org/pipermail/rust-dev/2013-April/003713.html
2013-04-24Implement Natural traitBrendan Zabarauskas-1/+1
This adds the following methods to ints and uints: - div - modulo - div_mod - quot_rem - gcd - lcm - divisible_by - is_even - is_odd I have not implemented Natural for BigInt and BigUInt because they're a little over my head.
2013-04-24Implement Signed and Unsigned traits and remove related predicate functionsBrendan Zabarauskas-1/+1
2013-04-22auto merge of #5980 : Kimundi/rust/ascii-encoding, r=thestingerbors-1/+2
Added Ascii type to use for byte inputs that are known to contain Ascii only.
2013-04-22Moved ascii out of strMarvin Löbel-5/+1
Removed deriving Ord, which allowed to remove the stage markers
2013-04-22Rename Div operator trait to Quot and Modulo operator trait to RemBrendan Zabarauskas-0/+5
2013-04-20Added Ascii typeMarvin Löbel-1/+6
2013-04-19librustc: WIP patch for using the return value.Patrick Walton-1/+1