File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -745,7 +745,7 @@ where
745745 where
746746 Out : Default + EnumSetType + Eq + PartialEq ,
747747 {
748- if exp != & Default :: default ( ) {
748+ if exp != & Out :: default ( ) {
749749 f( )
750750 } else {
751751 Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ use crate::metadata::{BuildProfile, Platform};
2424///
2525/// [`Test`]: crate::metadata::Test
2626/// [`Subtest`]: crate::metadata::Subtest
27- #[ derive( Clone , Copy , Eq , PartialEq ) ]
27+ #[ derive( Clone , Copy ) ]
2828pub struct Expected < Out > ( EnumSet < Out > )
2929where
3030 Out : EnumSetType ;
@@ -191,6 +191,26 @@ where
191191 }
192192}
193193
194+ impl < Out > PartialEq for Expected < Out >
195+ where
196+ Out : EnumSetType + Eq ,
197+ {
198+ fn eq ( & self , other : & Self ) -> bool {
199+ self . inner ( ) == other. inner ( )
200+ }
201+ }
202+
203+ impl < Out > PartialEq < Out > for Expected < Out >
204+ where
205+ Out : EnumSetType + Eq ,
206+ {
207+ fn eq ( & self , other : & Out ) -> bool {
208+ self . inner ( ) == * other
209+ }
210+ }
211+
212+ impl < Out > Eq for Expected < Out > where Out : EnumSetType + Eq { }
213+
194214/// Similar to the ubiquitous `enum Either`, but with the implication that `Collapsed` values are
195215/// abbreviations of equivalent `Expanded` values.
196216#[ derive( Clone , Debug , Eq , PartialEq ) ]
You can’t perform that action at this time.
0 commit comments