diff options
| author | Tyler Mandry <tmandry@gmail.com> | 2020-08-31 19:18:29 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-31 19:18:29 -0700 |
| commit | 9d435d25438e5732805f5afd7f80642799717ebf (patch) | |
| tree | b61eb2bfb8947cdc71ec196ef2d0eccf8ce4cf62 | |
| parent | 90e4bfa952e0908e47b0948be62c02696046680f (diff) | |
| parent | 4404cc5bc7c4b2e9f2f446bca0e59531c1bfce05 (diff) | |
| download | rust-9d435d25438e5732805f5afd7f80642799717ebf.tar.gz rust-9d435d25438e5732805f5afd7f80642799717ebf.zip | |
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
| -rw-r--r-- | library/core/src/cmp.rs | 6 | ||||
| -rw-r--r-- | src/test/ui/consts/const-ordering.rs | 15 |
2 files changed, 2 insertions, 19 deletions
diff --git a/library/core/src/cmp.rs b/library/core/src/cmp.rs index dde442aa7b5..3953c73319f 100644 --- a/library/core/src/cmp.rs +++ b/library/core/src/cmp.rs @@ -356,9 +356,8 @@ impl Ordering { /// ``` #[inline] #[must_use] - #[rustc_const_stable(feature = "const_ordering", since = "1.48.0")] #[stable(feature = "rust1", since = "1.0.0")] - pub const fn reverse(self) -> Ordering { + pub fn reverse(self) -> Ordering { match self { Less => Greater, Equal => Equal, @@ -395,9 +394,8 @@ impl Ordering { /// ``` #[inline] #[must_use] - #[rustc_const_stable(feature = "const_ordering", since = "1.48.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 { Equal => other, _ => self, diff --git a/src/test/ui/consts/const-ordering.rs b/src/test/ui/consts/const-ordering.rs deleted file mode 100644 index 454f2da00df..00000000000 --- a/src/test/ui/consts/const-ordering.rs +++ /dev/null @@ -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); -} |
