about summary refs log tree commit diff
path: root/src/libcore/cmp.rs
AgeCommit message (Collapse)AuthorLines
2019-03-25Clarify `{Ord,f32,f64}::clamp` docs a littleTobias Bucher-4/+9
Explicitly call out when it returns NaN, adhere to the panic doc guidelines.
2019-03-18Replaced self-reflective explicit types with clearer `Self` or `Self::…` ↵Vincent Esche-7/+7
in stdlib docs
2019-03-15Auto merge of #58710 - EdorianDark:master, r=sfacklerbors-0/+26
Add clamp for ranges. Implements #44095 Ready for merge
2019-03-09Use lifetime contravariance to elide more lifetimes in core+alloc+stdScott McMurray-24/+24
2019-03-09Revert "Revert "Add clamp functions""Dirk Leifeld-0/+26
2019-02-10tests: doc commentsAlexander Regueiro-1/+1
2019-01-18Rollup merge of #57357 - frewsxcv:frewsxcv-partial-eq, r=QuietMisdreavusMazdak Farrokhzad-16/+22
Cleanup PartialEq docs. - 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.
2019-01-15demonstrate symmetryCorey Farwell-1/+1
2019-01-12whitespaceCorey Farwell-6/+6
2019-01-12bring back the example i removed, also add symmetry and simplify implCorey Farwell-0/+42
2019-01-12add comment explaining what the derive doesCorey Farwell-0/+1
2019-01-11re-do docs for core::cmpSteve Klabnik-20/+15
Fixes #32934
2019-01-06Update cmp.rsCorey Farwell-1/+1
2019-01-06add missing derive to fix compile errorCorey Farwell-0/+1
2019-01-05Fix compile errorCorey Farwell-1/+1
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