Constify Eq, Ord, PartialOrd
This commit is contained in:
@@ -215,19 +215,18 @@ fn cmp_default() {
|
||||
assert_eq!(Fool(false), Fool(true));
|
||||
}
|
||||
|
||||
/* FIXME(#110395)
|
||||
mod const_cmp {
|
||||
use super::*;
|
||||
|
||||
struct S(i32);
|
||||
|
||||
impl PartialEq for S {
|
||||
impl const PartialEq for S {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.0 == other.0
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialOrd for S {
|
||||
impl const PartialOrd for S {
|
||||
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
|
||||
let ret = match (self.0, other.0) {
|
||||
(a, b) if a > b => Ordering::Greater,
|
||||
@@ -247,4 +246,3 @@ mod const_cmp {
|
||||
const _: () = assert!(S(0) < S(1));
|
||||
const _: () = assert!(S(1) > S(0));
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#![feature(cfg_target_has_reliable_f16_f128)]
|
||||
#![feature(char_max_len)]
|
||||
#![feature(clone_to_uninit)]
|
||||
#![feature(const_cmp)]
|
||||
#![feature(const_convert)]
|
||||
#![feature(const_destruct)]
|
||||
#![feature(const_eval_select)]
|
||||
|
||||
Reference in New Issue
Block a user