summary refs log tree commit diff
path: root/src/libcore/tuple.rs
AgeCommit message (Collapse)AuthorLines
2014-07-04core: add a primitive page for `()`.Huon Wilson-304/+0
2014-06-29Implement RFC#28: Add PartialOrd::partial_cmpSteven Fackler-0/+15
I ended up altering the semantics of Json's PartialOrd implementation. It used to be the case that Null < Null, but I can't think of any reason for an ordering other than the default one so I just switched it over to using the derived implementation. This also fixes broken `PartialOrd` implementations for `Vec` and `TreeMap`. RFC: 0028-partial-cmp
2014-06-29Extract tests from libcore to a separate crateSteven Fackler-97/+2
Libcore's test infrastructure is complicated by the fact that many lang items are defined in the crate. The current approach (realcore/realstd imports) is hacky and hard to work with (tests inside of core::cmp haven't been run for months!). Moving tests to a separate crate does mean that they can only test the public API of libcore, but I don't feel that that is too much of an issue. The only tests that I had to get rid of were some checking the various numeric formatters, but those are also exercised through normal format! calls in other tests.
2014-06-24core: Add stability attributes to CloneBrian Anderson-0/+1
The following are tagged 'unstable' - core::clone - Clone - Clone::clone - impl Clone for Arc - impl Clone for arc::Weak - impl Clone for Rc - impl Clone for rc::Weak - impl Clone for Vec - impl Clone for Cell - impl Clone for RefCell - impl Clone for small tuples The following are tagged 'experimental' - Clone::clone_from - may not provide enough utility - impls for various extern "Rust" fns - may not handle lifetimes correctly See https://github.com/rust-lang/rust/wiki/Meeting-API-review-2014-06-23#clone
2014-06-24librustc: Remove the fallback to `int` from typechecking.Niko Matsakis-15/+15
This breaks a fair amount of code. The typical patterns are: * `for _ in range(0, 10)`: change to `for _ in range(0u, 10)`; * `println!("{}", 3)`: change to `println!("{}", 3i)`; * `[1, 2, 3].len()`: change to `[1i, 2, 3].len()`. RFC #30. Closes #6023. [breaking-change]
2014-06-01std: Drop Total from Total{Eq,Ord}Alex Crichton-5/+5
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-31rustdoc: Create anchor pages for primitive typesAlex Crichton-0/+2
This commit adds support in rustdoc to recognize the `#[doc(primitive = "foo")]` attribute. This attribute indicates that the current module is the "owner" of the primitive type `foo`. For rustdoc, this means that the doc-comment for the module is the doc-comment for the primitive type, plus a signal to all downstream crates that hyperlinks for primitive types will be directed at the crate containing the `#[doc]` directive. Additionally, rustdoc will favor crates closest to the one being documented which "implements the primitive type". For example, documentation of libcore links to libcore for primitive types, but documentation for libstd and beyond all links to libstd for primitive types. This change involves no compiler modifications, it is purely a rustdoc change. The landing pages for the primitive types primarily serve to show a list of implemented traits for the primitive type itself. The primitive types documented includes both strings and slices in a semi-ad-hoc way, but in a way that should provide at least somewhat meaningful documentation. Closes #14474
2014-05-30std: Rename {Eq,Ord} to Partial{Eq,Ord}Alex Crichton-6/+6
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-29std: Recreate a `rand` moduleAlex Crichton-1/+1
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-26Improve docs for core::tuplePiotr Jawniak-2/+50
2014-05-22libcore: Remove all uses of `~str` from `libcore`.Patrick Walton-5/+8
[breaking-change]
2014-05-07core: Get coretest workingAlex Crichton-1/+1
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.
2014-05-07core: Inherit the tuple moduleAlex Crichton-0/+330
2013-05-22libstd: Rename libcore to libstd and libstd to libextra; update makefiles.Patrick Walton-439/+0
This only changes the directory names; it does not change the "real" metadata names.
2013-05-19Correct tuple Ord impl, add Total{Eq,Ord} impls and add some tests.Huon Wilson-19/+87
2013-05-19Move tuple tests into submoduleBrendan Zabarauskas-48/+54
2013-05-19Fix Ord implementation to use lexical orderingBrendan Zabarauskas-14/+14
2013-05-19Replace Tuple{2..12} trait with CloneableTuple{2..12} and ImmutableTuple{2..12}Brendan Zabarauskas-116/+141
Make n{0..11} methods return cloned values, and create n{0..12}_ref methods for returning references
2013-05-19Use match instead of intermediate variableBrendan Zabarauskas-7/+9
2013-05-19Adapt the getter macro to implement Clone, Eq and Ord for n-ary tuplesBrendan Zabarauskas-145/+55
2013-05-18Return a reference to the tuple elements instead of copyingBrendan Zabarauskas-94/+92
2013-05-18Merge trait and impl macros by using an inner moduleBrendan Zabarauskas-129/+124
2013-05-18Use assert_eq! instead of assert!Brendan Zabarauskas-7/+7
2013-05-18use n{0..11} instead of _{0..12} for accessor method namesBrendan Zabarauskas-100/+100
2013-05-18Create tuple element accessor traitsBrendan Zabarauskas-0/+165
2013-05-08Remove #[cfg(notest)] and use #[cfg(not(test))] to cooincide with #[cfg(debug)]Zack Corr-7/+7
2013-05-04Register snapshotsBrian Anderson-28/+0
2013-04-25Rename vec::mod2 to vec::mod_zipCorey Richardson-2/+2
2013-04-10core: changes in response to #5656Niko Matsakis-0/+28
2013-04-10Reason about nested free variables that appear in a functionNiko Matsakis-1/+0
signature. In a nutshell, the idea is to (1) report an error if, for a region pointer `'a T`, the lifetime `'a` is longer than any lifetimes that appear in `T` (in other words, if a borrowed pointer outlives any portion of its contents) and then (2) use this to assume that in a function like `fn(self: &'a &'b T)`, the relationship `'a <= 'b` holds. This is needed for #5656. Fixes #5728.
2013-04-03Implement Clone for tuplesJames Miller-0/+17
2013-03-29librustc: Remove `fail_unless!`Patrick Walton-5/+5
2013-03-26librustc: Modify all code to use new lifetime binder syntaxPatrick Walton-1/+1
2013-03-26core: As per #4898, finish impls for one-tuplesTim Chevalier-1/+39
2013-03-22libcore: Remove `pure` from libcore. rs=depurePatrick Walton-22/+22
2013-03-18librustc: Convert all uses of old lifetime notation to new lifetime ↵Patrick Walton-5/+5
notation. rs=delifetiming
2013-03-07librustc: Convert all uses of `assert` over to `fail_unless!`Patrick Walton-5/+5
2013-03-06Add manual &self/ and &static/ and /&self declarations thatNiko Matsakis-1/+1
are currently inferred. New rules are coming that will require them to be explicit. All add some explicit self declarations.
2013-03-05auto merge of #5233 : bstrie/rust/deimpselfcore, r=graydonbors-9/+9
2013-03-04De-implicit-self libcoreBen Striegel-9/+9
2013-03-04Adding missing imports for tests, and gate off othersAlex Crichton-1/+2
2013-02-20librustc: Separate most trait bounds with '+'. rs=plussingPatrick Walton-7/+7
2013-02-18rustc: For one-tuples, make parsing and printing the type workTim Chevalier-0/+2
and add a test to reflect-visit-data
2013-02-14librustc: Replace `impl Type : Trait` with `impl Trait for Type`. ↵Patrick Walton-8/+8
rs=implflipping
2013-02-07Make ~fn non-copyable, make &fn copyable, split barefn/closure types,Niko Matsakis-4/+0
correct handling of moves for struct-record update. Part of #3678. Fixes #2828, #3904, #4719.
2013-01-14Inlining methods/functions in core.gifnksm-0/+21
Also inlining some functions which take functions as arguments.
2013-01-08librustc: Make unqualified identifier searches terminate at the nearest ↵Patrick Walton-0/+1
module scope. r=tjc
2013-01-08Revert "librustc: Make unqualified identifier searches terminate at the ↵Patrick Walton-1/+0
nearest module scope. r=tjc" This reverts commit a8d37af2473da79be704c9ce2374f278c47177b6.
2013-01-08librustc: Make unqualified identifier searches terminate at the nearest ↵Patrick Walton-0/+1
module scope. r=tjc
2012-12-27librustc: Terminate name searches at the nearest module scope for paths that ↵Patrick Walton-0/+1
contain at least two components. r=graydon