@@ -172,7 +172,7 @@ pub enum BoundType {
172172/// Represents a one-sided bound.
173173///
174174/// The side is determined by the `S` phantom parameter.
175- #[ deriving( Eq , Clone ) ]
175+ #[ deriving( Clone ) ]
176176pub struct RangeBound < S , T > {
177177 /// The value of the bound
178178 value : T ,
@@ -200,6 +200,12 @@ impl<S: BoundSided, T: fmt::Show> fmt::Show for RangeBound<S, T> {
200200 }
201201}
202202
203+ impl < S : BoundSided , T : Eq > Eq for RangeBound < S , T > {
204+ fn eq ( & self , other : & RangeBound < S , T > ) -> bool {
205+ self . value == other. value && self . type_ == other. type_
206+ }
207+ }
208+
203209impl < S : BoundSided , T : Ord > Ord for RangeBound < S , T > {
204210 fn lt ( & self , other : & RangeBound < S , T > ) -> bool {
205211 match ( BoundSided :: side ( None :: < S > ) , self . type_ , other. type_ ) {
@@ -229,6 +235,13 @@ impl<S: BoundSided, T: Ord> RangeBound<S, T> {
229235
230236struct OptBound < ' a , S , T > ( Option < & ' a RangeBound < S , T > > ) ;
231237
238+ impl < ' a , S : BoundSided , T : Eq > Eq for OptBound < ' a , S , T > {
239+ fn eq ( & self , & OptBound ( ref other) : & OptBound < ' a , S , T > ) -> bool {
240+ let & OptBound ( ref self_) = self ;
241+ self_ == other
242+ }
243+ }
244+
232245impl < ' a , S : BoundSided , T : Ord > Ord for OptBound < ' a , S , T > {
233246 fn lt ( & self , other : & OptBound < ' a , S , T > ) -> bool {
234247 match ( * self , * other) {
0 commit comments