about summary refs log tree commit diff
path: root/src/libcore/tuple.rs
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-213/+0
2019-11-26Format libcore with rustfmtDavid Tolnay-1/+1
This commit applies rustfmt with default settings to files in src/libcore *that are not involved in any currently open PR* to minimize merge conflicts. The list of files involved in open PRs was determined by querying GitHub's GraphQL API with this script: https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8 With the list of files from the script in `outstanding_files`, the relevant commands were: $ find src/libcore -name '*.rs' | xargs rustfmt --edition=2018 $ rg libcore outstanding_files | xargs git checkout -- Repeating this process several months apart should get us coverage of most of the rest of libcore.
2019-04-18libcore => 2018Taiki Endo-2/+2
2018-12-25Remove licensesMark Rousskov-10/+0
2017-08-31Update bootstrap compilerAlex Crichton-8/+0
This commit updates the bootstrap compiler and clears out a number of #[cfg(stage0)] annotations and related business
2017-08-14Make `Clone` a lang item and generate builtin impls.scalexm-0/+1
Fixes #28229. Fixes #24000.
2017-07-02Implement Eq/Hash/Debug etc. for unsized tuples.Masaki Hara-4/+10
2016-11-12Remove macro work-around.Mark-Simulacrum-8/+3
2016-08-24Use `#[prelude_import]` in `libcore`.Jeffrey Seyfried-4/+0
2016-02-09Properly document tuplesSteve Klabnik-18/+1
Fixes #29339
2015-11-18Add missing annotations and some testsVadim Petrochenkov-2/+0
2015-11-06Remove stability annotations from trait impl itemsVadim Petrochenkov-1/+0
Remove `stable` stability annotations from inherent impls
2015-07-20std: Create separate docs for the primitivesBrian Anderson-1/+0
Having the primitive and module docs derived from the same source causes problems, primarily that they can't contain hyperlinks cross-referencing each other. This crates dedicated private modules in `std` to document the primitive types, then for all primitives that have a corresponding module, puts hyperlinks in moth the primitive docs and the module docs cross-linking each other. This should help clear up confusion when readers find themselves on the wrong page.
2015-07-20doc: Clean up primitive short descriptionsBrian Anderson-1/+1
This makes the primitive descriptions on the front page read properly as descriptions of types and not of the associated modules.
2015-03-15core: Update tuple docUlrik Sverdrup-11/+5
Remove mention of removed methods `.val0` etc.
2015-03-15core: Remove unused parts of tuple macroUlrik Sverdrup-79/+79
2015-02-09Set up docs for missing core typesSteve Klabnik-0/+1
Fixes #22085
2015-01-23grandfathered -> rust1Brian Anderson-8/+8
2015-01-21Add 'feature' and 'since' to stability attributesBrian Anderson-8/+8
2015-01-14Remove erroneous stability attribute.Brian Anderson-3/+0
This outer attribute doesn't actually apply to anything is seems to be incorrect in what it is saying.
2015-01-03Remove deprecated functionalityAlex Crichton-38/+0
This removes a large array of deprecated functionality, regardless of how recently it was deprecated. The purpose of this commit is to clean out the standard libraries and compiler for the upcoming alpha release. Some notable compiler changes were to enable warnings for all now-deprecated command line arguments (previously the deprecated versions were silently accepted) as well as removing deriving(Zero) entirely (the trait was removed). The distribution no longer contains the libtime or libregex_macros crates. Both of these have been deprecated for some time and are available externally.
2015-01-02std: Stabilize the prelude moduleAlex Crichton-29/+0
This commit is an implementation of [RFC 503][rfc] which is a stabilization story for the prelude. Most of the RFC was directly applied, removing reexports. Some reexports are kept around, however: * `range` remains until range syntax has landed to reduce churn. * `Path` and `GenericPath` remain until path reform lands. This is done to prevent many imports of `GenericPath` which will soon be removed. * All `io` traits remain until I/O reform lands so imports can be rewritten all at once to `std::io::prelude::*`. This is a breaking change because many prelude reexports have been removed, and the RFC can be consulted for the exact list of removed reexports, as well as to find the locations of where to import them. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0503-prelude-stabilization.md [breaking-change] Closes #20068
2014-12-30Stabilize cmpAaron Turon-4/+4
This patch marks `PartialEq`, `Eq`, `PartialOrd`, and `Ord` as `#[stable]`, as well as the majorify of manual implementaitons of these traits. The traits match the [reform RFC](https://github.com/rust-lang/rfcs/pull/439). Along the way, two changes are made: * The recently-added type parameters for `Ord` and `Eq` are removed. These were mistakenly added while adding them to `PartialOrd` and `PartialEq`, but they don't make sense given the laws that are required for (and use cases for) `Ord` and `Eq`. * More explicit laws are added for `PartialEq` and `PartialOrd`, connecting them to their associated mathematical concepts. In the future, many of the impls should be generalized; see since generalizing later is not a breaking change. [breaking-change]
2014-12-22Remove cmp::Ordering::* public reexportCorey Farwell-0/+1
Part of #19253 I would have removed this public reexport in #19842, but #19812 hadn't merged (and snapshotted) at the time In #19407, I changed the codebase to stop utilizing this reexport [breaking-change]
2014-12-21rollup merge of #20070: aturon/stab-2-cloneAlex Crichton-2/+1
This patch marks `clone` stable, as well as the `Clone` trait, but leaves `clone_from` unstable. The latter will be decided by the beta. The patch also marks most manual implementations of `Clone` as stable, except where the APIs are otherwise deprecated or where there is uncertainty about providing `Clone`. r? @alexcrichton
2014-12-18std: Remove public bool,tuple,unit modulesAlex Crichton-0/+329
This commit modifies rustdoc to not require these empty modules to be public in the standard library. The modules still remain as a location to attach documentation to, but the modules themselves are now private (don't have to commit to an API). The documentation for the standard library now shows all of the primitive types on the main index page.
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