@@ -61,12 +61,16 @@ impl<T: Clone> Clone for Box<T> {
61
61
}
62
62
}
63
63
64
+ // NOTE(stage0): remove impl after a snapshot
65
+ #[ cfg( stage0) ]
64
66
impl < T : PartialEq > PartialEq for Box < T > {
65
67
#[ inline]
66
68
fn eq ( & self , other : & Box < T > ) -> bool { * ( * self ) == * ( * other) }
67
69
#[ inline]
68
70
fn ne ( & self , other : & Box < T > ) -> bool { * ( * self ) != * ( * other) }
69
71
}
72
+ // NOTE(stage0): remove impl after a snapshot
73
+ #[ cfg( stage0) ]
70
74
impl < T : PartialOrd > PartialOrd for Box < T > {
71
75
#[ inline]
72
76
fn partial_cmp ( & self , other : & Box < T > ) -> Option < Ordering > {
@@ -81,14 +85,50 @@ impl<T:PartialOrd> PartialOrd for Box<T> {
81
85
#[ inline]
82
86
fn gt ( & self , other : & Box < T > ) -> bool { * ( * self ) > * ( * other) }
83
87
}
88
+ // NOTE(stage0): remove impl after a snapshot
89
+ #[ cfg( stage0) ]
84
90
impl < T : Ord > Ord for Box < T > {
85
91
#[ inline]
86
92
fn cmp ( & self , other : & Box < T > ) -> Ordering {
87
93
( * * self ) . cmp ( & * * other)
88
94
}
89
95
}
96
+ // NOTE(stage0): remove impl after a snapshot
97
+ #[ cfg( stage0) ]
90
98
impl < T : Eq > Eq for Box < T > { }
91
99
100
+ #[ cfg( not( stage0) ) ] // NOTE(stage0): remove cfg after a snapshot
101
+ impl < Sized ? T : PartialEq > PartialEq for Box < T > {
102
+ #[ inline]
103
+ fn eq ( & self , other : & Box < T > ) -> bool { PartialEq :: eq ( & * * self , & * * other) }
104
+ #[ inline]
105
+ fn ne ( & self , other : & Box < T > ) -> bool { PartialEq :: ne ( & * * self , & * * other) }
106
+ }
107
+ #[ cfg( not( stage0) ) ] // NOTE(stage0): remove cfg after a snapshot
108
+ impl < Sized ? T : PartialOrd > PartialOrd for Box < T > {
109
+ #[ inline]
110
+ fn partial_cmp ( & self , other : & Box < T > ) -> Option < Ordering > {
111
+ PartialOrd :: partial_cmp ( & * * self , & * * other)
112
+ }
113
+ #[ inline]
114
+ fn lt ( & self , other : & Box < T > ) -> bool { PartialOrd :: lt ( & * * self , & * * other) }
115
+ #[ inline]
116
+ fn le ( & self , other : & Box < T > ) -> bool { PartialOrd :: le ( & * * self , & * * other) }
117
+ #[ inline]
118
+ fn ge ( & self , other : & Box < T > ) -> bool { PartialOrd :: ge ( & * * self , & * * other) }
119
+ #[ inline]
120
+ fn gt ( & self , other : & Box < T > ) -> bool { PartialOrd :: gt ( & * * self , & * * other) }
121
+ }
122
+ #[ cfg( not( stage0) ) ] // NOTE(stage0): remove cfg after a snapshot
123
+ impl < Sized ? T : Ord > Ord for Box < T > {
124
+ #[ inline]
125
+ fn cmp ( & self , other : & Box < T > ) -> Ordering {
126
+ Ord :: cmp ( & * * self , & * * other)
127
+ }
128
+ }
129
+ #[ cfg( not( stage0) ) ] // NOTE(stage0): remove cfg after a snapshot
130
+ impl < Sized ? T : Eq > Eq for Box < T > { }
131
+
92
132
/// Extension methods for an owning `Any` trait object.
93
133
#[ unstable = "post-DST and coherence changes, this will not be a trait but \
94
134
rather a direct `impl` on `Box<Any>`"]
0 commit comments