mirror of https://github.com/rust-lang/rust.git
Rollup merge of #76172 - ecstatic-morse:revert-75463, r=RalfJung
Revert #75463 This was approved by me prematurely. It needs T-libs approval. Sorry @CDirkx. r? @RalfJung
This commit is contained in:
commit
9d435d2543
|
@ -356,9 +356,8 @@ impl Ordering {
|
||||||
/// ```
|
/// ```
|
||||||
#[inline]
|
#[inline]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
#[rustc_const_stable(feature = "const_ordering", since = "1.48.0")]
|
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
pub const fn reverse(self) -> Ordering {
|
pub fn reverse(self) -> Ordering {
|
||||||
match self {
|
match self {
|
||||||
Less => Greater,
|
Less => Greater,
|
||||||
Equal => Equal,
|
Equal => Equal,
|
||||||
|
@ -395,9 +394,8 @@ impl Ordering {
|
||||||
/// ```
|
/// ```
|
||||||
#[inline]
|
#[inline]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
#[rustc_const_stable(feature = "const_ordering", since = "1.48.0")]
|
|
||||||
#[stable(feature = "ordering_chaining", since = "1.17.0")]
|
#[stable(feature = "ordering_chaining", since = "1.17.0")]
|
||||||
pub const fn then(self, other: Ordering) -> Ordering {
|
pub fn then(self, other: Ordering) -> Ordering {
|
||||||
match self {
|
match self {
|
||||||
Equal => other,
|
Equal => other,
|
||||||
_ => self,
|
_ => self,
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
// run-pass
|
|
||||||
|
|
||||||
use std::cmp::Ordering;
|
|
||||||
|
|
||||||
// the following methods of core::cmp::Ordering are const:
|
|
||||||
// - reverse
|
|
||||||
// - then
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
const REVERSE : Ordering = Ordering::Greater.reverse();
|
|
||||||
assert_eq!(REVERSE, Ordering::Less);
|
|
||||||
|
|
||||||
const THEN : Ordering = Ordering::Equal.then(REVERSE);
|
|
||||||
assert_eq!(THEN, Ordering::Less);
|
|
||||||
}
|
|
Loading…
Reference in New Issue