about summary refs log tree commit diff
path: root/src/libcore/cmp.rs
AgeCommit message (Collapse)AuthorLines
2019-01-05Cleanup PartialEq docs.Corey Farwell-47/+9
- Cleanup the `impl PartialEq<BookFormat> for Book` implementation - Implement `impl PartialEq<Book> for BookFormat` so it’s symmetric - Fixes https://github.com/rust-lang/rust/issues/53844. - Removes the last example since it appears to be redundant with the previous two examples.
2018-12-29Specify criterion for PartialOrdCzipperz-2/+3
2018-12-29Make std::cmp::Ord documentation specify what it means to agree with PartialEqCzipperz-3/+4
2018-12-25Remove licensesMark Rousskov-10/+0
2018-09-29Use impl_header_lifetime_elision in libcoreScott McMurray-6/+6
2018-08-21Add another PartialEq exampleGuillaume Gomez-1/+84
2018-08-09inline some short functionsM Farkas-Dyck-0/+2
2018-06-19Add message to `rustc_on_unimplemented` attributes in coreEsteban Küber-2/+8
2018-04-26Add more doc aliasesGuillaume Gomez-0/+12
2018-04-20Revert stabilization of `feature(never_type)`.Felix S. Klock II-4/+4
This commit is just covering the feature gate itself and the tests that made direct use of `!` and thus need to opt back into the feature. A follow on commit brings back the other change that motivates the revert: Namely, going back to the old rules for falling back to `()`.
2018-04-05Bump the bootstrap compiler to 1.26.0 betaAlex Crichton-3/+2
Holy cow that's a lot of `cfg(stage0)` removed and a lot of new stable language features!
2018-03-14change never_type stabilisation versionAndrew Cann-4/+4
2018-03-14Fix version numberAndrew Cann-4/+4
2018-03-14stabilise feature(never_type)Andrew Cann-4/+4
Replace feature(never_type) with feature(exhaustive_patterns). feature(exhaustive_patterns) only covers the pattern-exhaustives checks that used to be covered by feature(never_type)
2018-03-08Produce instead of pointersOliver Schneider-1/+3
2018-02-28impl Default + Hash for ::core::cmp::ReverseM Farkas-Dyck-1/+1
2018-01-12Derive std::cmp::Reverse as Copy or CloneDan Aloni-1/+1
If the type parameter is Copy or Clone, then `Reverse` should be too.
2017-12-12Rename never_type_impls gate to never_typeAndrew Cann-4/+4
2017-10-05Auto merge of #44943 - nivkner:fixme_fixup, r=dtolnaybors-2/+2
address some FIXME whose associated issues were marked as closed part of #44366
2017-09-30address some `FIXME`s whose associated issues were marked as closedNiv Kaminer-2/+2
remove FIXME(#13101) since `assert_receiver_is_total_eq` stays. remove FIXME(#19649) now that stability markers render. remove FIXME(#13642) now the benchmarks were moved. remove FIXME(#6220) now that floating points can be formatted. remove FIXME(#18248) and write tests for `Rc<str>` and `Rc<[u8]>` remove reference to irelevent issues in FIXME(#1697, #2178...) update FIXME(#5516) to point to getopts issue 7 update FIXME(#7771) to point to RFC 628 update FIXME(#19839) to point to issue 26925
2017-09-24Backport libs stabilizations to 1.21 betaDavid Tolnay-2/+2
This includes the following stabilizations: - tcpstream_connect_timeout https://github.com/rust-lang/rust/pull/44563 - iterator_for_each https://github.com/rust-lang/rust/pull/44567 - ord_max_min https://github.com/rust-lang/rust/pull/44593 - compiler_fences https://github.com/rust-lang/rust/pull/44595 - needs_drop https://github.com/rust-lang/rust/pull/44639 - vec_splice https://github.com/rust-lang/rust/pull/44640
2017-09-15stabilized ord_max_min (fixes #25663)Michal Budzynski-6/+2
2017-09-08Revert "Add clamp functions"Jacob Kiesel-26/+0
This reverts commit c589f867f89d4e6e48c6602aed8e878208d4822f.
2017-09-08Revert "Fix documentation and formatting."Jacob Kiesel-7/+9
This reverts commit 2e34ff767113c6a15c5862b0646ca9ad7ffd81b1.
2017-09-01Fix documentation and formatting.Jacob Kiesel-9/+7
2017-08-26Add clamp functionsJacob Kiesel-0/+26
2017-08-08mark comparison trait methods as #[must_use]Zack M. Davis-0/+7
Note that this doesn't actually give us warnings on `a == b;` and the like, as some observers may have hoped. This is in the matter of #43302.
2017-07-20std: Cut down #[inline] annotations where not necessaryAlex Crichton-1/+1
This PR cuts down on a large number of `#[inline(always)]` and `#[inline]` annotations in libcore for various core functions. The `#[inline(always)]` annotation is almost never needed and is detrimental to debug build times as it forces LLVM to perform inlining when it otherwise wouldn't need to in debug builds. Additionally `#[inline]` is an unnecessary annoation on almost all generic functions because the function will already be monomorphized into other codegen units and otherwise rarely needs the extra "help" from us to tell LLVM to inline something. Overall this PR cut the compile time of a [microbenchmark][1] by 30% from 1s to 0.7s. [1]: https://gist.github.com/alexcrichton/a7d70319a45aa60cf36a6a7bf540dd3a
2017-07-03Add a stability marker for core::cmp::Reverse.0Steven Fackler-1/+1
Closes #43027
2017-06-29Rollup merge of #42920 - behnam:cmp, r=BurntSushiAriel Ben-Yehuda-4/+6
[libcore/cmp] Expand Ord/PartialOrd Derivable doc for enum types Expand Derivable docblock section for `Ord` and `PartialOrd` to cover `enum` types, in addition to the existing language explaining it for `struct` types.
2017-06-26[libcore/cmp] Expand Ord/PartialOrd Derivable doc for enum typesBehnam Esfahbod-4/+6
Expand Derivable docblock section for `Ord` and `PartialOrd` to cover `enum` types, in addition to the existing language explaining it for `struct` types.
2017-06-24Stabilize cmp::ReverseSteven Fackler-4/+3
Closes #40893
2017-06-06Alias std::cmp::max/min to Ord::max/minNick Whitney-2/+6
2017-06-06Add max and min default fns to Ord traitNick Whitney-0/+36
Pursuant to issue #25663, this commit adds the max and min functions to the Ord trait, enabling items that implement Ord to use UFCS (ex. 1.max(2)) instead of the longer std::cmp::max(1,2) format.
2017-05-27Rollup merge of #42260 - stjepang:document-cmp-traits-agreement, r=alexcrichtonMark Simulacrum-2/+14
Docs: impls of PartialEq/PartialOrd/Ord must agree Fixes #41270. This PR brings two improvements to the docs: 1. Docs for `PartialEq`, `PartialOrd`, and `Ord` clarify that their implementations must agree. 2. Fixes a subtle bug in the Dijkstra example for `BinaryHeap`, where the impls are inconsistent. Thanks @Rufflewind for spotting the bug! r? @alexcrichton cc @frankmcsherry
2017-05-27Docs: impls of PartialEq/PartialOrd/Ord must agreeStjepan Glavina-2/+14
2017-04-10Explicit help message for binop type missmatchEsteban Küber-0/+2
When trying to do a binary operation with missing implementation, for example `1 + Some(2)`, provide an explicit help message: ``` note: no implementation for `{integer} + std::option::Option<{integer}>` ``` Use `rustc_on_unimplemented` for the suggestions. Move cfail test to ui.
2017-03-30cmp: Implement all PartialOrd methods for ReverseUlrik Sverdrup-0/+9
When making a forwarding wrapper we must in general forward all methods, so that we use the type's own `lt` for example instead of the default. Example important case: f32's partial_cmp does several operations but its lt is a primitive.
2017-03-29Rollup merge of #40720 - mitsuhiko:feature/rev-key, r=BurntSushiCorey Farwell-0/+35
Added core::cmp::Reverse for sort_by_key reverse sorting I'm not sure if this is the best way to go about proposing this feature but it's pretty useful. It allows you to use `sort_by_key` and return tuples where a single item is then reversed to how it normally sorts. I quite miss something like this in Rust currently though I'm not sure if this is the best way to implement it.
2017-03-29Updated tracking issue for cmp::ReverseArmin Ronacher-3/+3
2017-03-29Changed cmp::Reverse to unstableArmin Ronacher-3/+4
2017-03-22Various fixes to wording consistency in the docsStjepan Glavina-3/+3
2017-03-22Improved bounds for cmp::ReverseArmin Ronacher-6/+6
2017-03-22Fix the test for cmp::ReverseArmin Ronacher-1/+1
2017-03-22Added core::cmp::Reverse for sort_by_key reverse sortingArmin Ronacher-0/+34
2017-03-17Stabilize ordering_chaining, closes #37053Aaron Turon-6/+2
2017-03-14Inline functions Ordering::{then, then_with}Stjepan Glavina-0/+2
@jongiddy noticed bad performance due to the lack of inlining on `then` and `then_with`. I confirmed that inlining really is the culprit by creating a custom `then` function and repeating his benchmark on my machine with and without the `#[inline]` attribute. The numbers were exactly the same on my machine without the attribute. With `#[inline]` I got the same performance as I did with manually inlined implementation.
2017-02-03Bump version, upgrade bootstrapAlex Crichton-9/+3
This commit updates the version number to 1.17.0 as we're not on that version of the nightly compiler, and at the same time this updates src/stage0.txt to bootstrap from freshly minted beta compiler and beta Cargo.
2016-12-30Such large. Very 128. Much bits.Simonas Kazlauskas-0/+6
This commit introduces 128-bit integers. Stage 2 builds and produces a working compiler which understands and supports 128-bit integers throughout. The general strategy used is to have rustc_i128 module which provides aliases for iu128, equal to iu64 in stage9 and iu128 later. Since nowhere in rustc we rely on large numbers being supported, this strategy is good enough to get past the first bootstrap stages to end up with a fully working 128-bit capable compiler. In order for this strategy to work, number of locations had to be changed to use associated max_value/min_value instead of MAX/MIN constants as well as the min_value (or was it max_value?) had to be changed to use xor instead of shift so both 64-bit and 128-bit based consteval works (former not necessarily producing the right results in stage1). This commit includes manual merge conflict resolution changes from a rebase by @est31.
2016-12-29Fix typo in PartialOrd docsLuc Street-1/+1