@@ -16,44 +16,44 @@ macro_rules! b {
1616// Implements the Not trait but with an output type
1717// that's not bool. Should not suggest a rewrite
1818#[ derive( Debug ) ]
19- enum A {
19+ enum ImplNotTraitWithoutBool {
2020 VariantX ( bool ) ,
2121 VariantY ( u32 ) ,
2222}
2323
24- impl PartialEq < bool > for A {
24+ impl PartialEq < bool > for ImplNotTraitWithoutBool {
2525 fn eq ( & self , other : & bool ) -> bool {
2626 match * self {
27- A :: VariantX ( b) => b == * other,
27+ ImplNotTraitWithoutBool :: VariantX ( b) => b == * other,
2828 _ => false ,
2929 }
3030 }
3131}
3232
33- impl Not for A {
33+ impl Not for ImplNotTraitWithoutBool {
3434 type Output = Self ;
3535
3636 fn not ( self ) -> Self :: Output {
3737 match self {
38- A :: VariantX ( b) => A :: VariantX ( !b) ,
39- A :: VariantY ( 0 ) => A :: VariantY ( 1 ) ,
40- A :: VariantY ( _) => A :: VariantY ( 0 ) ,
38+ ImplNotTraitWithoutBool :: VariantX ( b) => ImplNotTraitWithoutBool :: VariantX ( !b) ,
39+ ImplNotTraitWithoutBool :: VariantY ( 0 ) => ImplNotTraitWithoutBool :: VariantY ( 1 ) ,
40+ ImplNotTraitWithoutBool :: VariantY ( _) => ImplNotTraitWithoutBool :: VariantY ( 0 ) ,
4141 }
4242 }
4343}
4444
4545// This type implements the Not trait with an Output of
4646// type bool. Using assert!(..) must be suggested
4747#[ derive( Debug ) ]
48- struct B ;
48+ struct ImplNotTraitWithBool ;
4949
50- impl PartialEq < bool > for B {
50+ impl PartialEq < bool > for ImplNotTraitWithBool {
5151 fn eq ( & self , other : & bool ) -> bool {
5252 false
5353 }
5454}
5555
56- impl Not for B {
56+ impl Not for ImplNotTraitWithBool {
5757 type Output = bool ;
5858
5959 fn not ( self ) -> Self :: Output {
@@ -62,8 +62,8 @@ impl Not for B {
6262}
6363
6464fn main ( ) {
65- let a = A :: VariantX ( true ) ;
66- let b = B { } ;
65+ let a = ImplNotTraitWithoutBool :: VariantX ( true ) ;
66+ let b = ImplNotTraitWithBool ;
6767
6868 assert_eq ! ( "a" . len( ) , 1 ) ;
6969 assert_eq ! ( "a" . is_empty( ) , false ) ;
0 commit comments