@@ -116,10 +116,7 @@ fn test_expr() {
116
116
117
117
// ExprKind::Binary
118
118
assert_eq ! ( stringify_expr!( true || false ) , "true || false" ) ;
119
- assert_eq ! (
120
- stringify_expr!( true || false && false ) ,
121
- "true || false && false" ,
122
- ) ;
119
+ assert_eq ! ( stringify_expr!( true || false && false ) , "true || false && false" ) ;
123
120
124
121
// ExprKind::Unary
125
122
assert_eq ! ( stringify_expr!( * expr) , "*expr" ) ;
@@ -180,10 +177,7 @@ fn test_expr() {
180
177
// ExprKind::While
181
178
assert_eq ! ( stringify_expr!( while true { } ) , "while true {}" ) ;
182
179
assert_eq ! ( stringify_expr!( ' a: while true { } ) , "'a: while true {}" ) ;
183
- assert_eq ! (
184
- stringify_expr!( while let true = true { } ) ,
185
- "while let true = true {}" ,
186
- ) ;
180
+ assert_eq ! ( stringify_expr!( while let true = true { } ) , "while let true = true {}" ) ;
187
181
188
182
// ExprKind::ForLoop
189
183
assert_eq ! ( stringify_expr!( for _ in x { } ) , "for _ in x {}" ) ;
@@ -328,14 +322,8 @@ fn test_expr() {
328
322
assert_eq ! ( stringify_expr!( Struct { x, .. } ) , "Struct{x, ..}" ) ;
329
323
assert_eq ! ( stringify_expr!( Struct { x, ..base } ) , "Struct{x, ..base}" ) ;
330
324
assert_eq ! ( stringify_expr!( Struct { x: true } ) , "Struct{x: true,}" ) ;
331
- assert_eq ! (
332
- stringify_expr!( Struct { x: true , .. } ) ,
333
- "Struct{x: true, ..}" ,
334
- ) ;
335
- assert_eq ! (
336
- stringify_expr!( Struct { x: true , ..base } ) ,
337
- "Struct{x: true, ..base}" ,
338
- ) ;
325
+ assert_eq ! ( stringify_expr!( Struct { x: true , .. } ) , "Struct{x: true, ..}" ) ;
326
+ assert_eq ! ( stringify_expr!( Struct { x: true , ..base } ) , "Struct{x: true, ..base}" ) ;
339
327
340
328
// ExprKind::Repeat
341
329
assert_eq ! ( stringify_expr!( [ ( ) ; 0 ] ) , "[(); 0]" ) ;
@@ -501,7 +489,10 @@ fn test_item() {
501
489
) ;
502
490
assert_eq ! (
503
491
stringify_item!(
504
- enum Enum <T > where T : ' a {
492
+ enum Enum <T >
493
+ where
494
+ T : ' a,
495
+ {
505
496
Unit ,
506
497
Tuple ( T ) ,
507
498
Struct { t: T } ,
@@ -660,10 +651,7 @@ fn test_pat() {
660
651
// PatKind::Struct
661
652
assert_eq ! ( stringify_pat!( Struct { } ) , "Struct { }" ) ; // FIXME
662
653
assert_eq ! ( stringify_pat!( Struct :: <u8 > { } ) , "Struct::<u8> { }" ) ;
663
- assert_eq ! (
664
- stringify_pat!( Struct :: <' static > { } ) ,
665
- "Struct::<'static> { }" ,
666
- ) ;
654
+ assert_eq ! ( stringify_pat!( Struct :: <' static > { } ) , "Struct::<'static> { }" ) ;
667
655
assert_eq ! ( stringify_pat!( Struct { x } ) , "Struct { x }" ) ;
668
656
assert_eq ! ( stringify_pat!( Struct { x: _x } ) , "Struct { x: _x }" ) ;
669
657
assert_eq ! ( stringify_pat!( Struct { .. } ) , "Struct { .. }" ) ;
@@ -682,10 +670,7 @@ fn test_pat() {
682
670
assert_eq ! ( stringify_pat!( Tuple ( x) ) , "Tuple(x)" ) ;
683
671
assert_eq ! ( stringify_pat!( Tuple ( ..) ) , "Tuple(..)" ) ;
684
672
assert_eq ! ( stringify_pat!( Tuple ( x, ..) ) , "Tuple(x, ..)" ) ;
685
- assert_eq ! (
686
- stringify_pat!( <Struct as Trait >:: Type ( ) ) ,
687
- "<Struct as Trait>::Type()" ,
688
- ) ;
673
+ assert_eq ! ( stringify_pat!( <Struct as Trait >:: Type ( ) ) , "<Struct as Trait>::Type()" ) ;
689
674
690
675
// PatKind::Or
691
676
assert_eq ! ( stringify_pat!( true | false ) , "true | false" ) ;
@@ -696,10 +681,7 @@ fn test_pat() {
696
681
assert_eq ! ( stringify_pat!( crate :: Path ) , "crate::Path" ) ;
697
682
assert_eq ! ( stringify_pat!( Path :: <u8 >) , "Path::<u8>" ) ;
698
683
assert_eq ! ( stringify_pat!( Path :: <' static >) , "Path::<'static>" ) ;
699
- assert_eq ! (
700
- stringify_pat!( <Struct as Trait >:: Type ) ,
701
- "<Struct as Trait>::Type" ,
702
- ) ;
684
+ assert_eq ! ( stringify_pat!( <Struct as Trait >:: Type ) , "<Struct as Trait>::Type" ) ;
703
685
704
686
// PatKind::Tuple
705
687
assert_eq ! ( stringify_pat!( ( ) ) , "()" ) ;
@@ -826,10 +808,7 @@ fn test_ty() {
826
808
assert_eq ! ( stringify_ty!( PhantomData :: <T >) , "PhantomData<T>" ) ;
827
809
assert_eq ! ( stringify_ty!( Fn ( ) -> !) , "Fn() -> !" ) ;
828
810
assert_eq ! ( stringify_ty!( Fn ( u8 ) -> !) , "Fn(u8) -> !" ) ;
829
- assert_eq ! (
830
- stringify_ty!( <Struct as Trait >:: Type ) ,
831
- "<Struct as Trait>::Type" ,
832
- ) ;
811
+ assert_eq ! ( stringify_ty!( <Struct as Trait >:: Type ) , "<Struct as Trait>::Type" ) ;
833
812
834
813
// TyKind::TraitObject
835
814
assert_eq ! ( stringify_ty!( dyn Send ) , "dyn Send" ) ;
@@ -874,14 +853,8 @@ fn test_vis() {
874
853
assert_eq ! ( stringify_vis!( pub ( in super ) ) , "pub(super) " ) ;
875
854
assert_eq ! ( stringify_vis!( pub ( in path:: to) ) , "pub(in path::to) " ) ;
876
855
assert_eq ! ( stringify_vis!( pub ( in :: path:: to) ) , "pub(in ::path::to) " ) ;
877
- assert_eq ! (
878
- stringify_vis!( pub ( in self :: path:: to) ) ,
879
- "pub(in self::path::to) " ,
880
- ) ;
881
- assert_eq ! (
882
- stringify_vis!( pub ( in super :: path:: to) ) ,
883
- "pub(in super::path::to) " ,
884
- ) ;
856
+ assert_eq ! ( stringify_vis!( pub ( in self :: path:: to) ) , "pub(in self::path::to) " ) ;
857
+ assert_eq ! ( stringify_vis!( pub ( in super :: path:: to) ) , "pub(in super::path::to) " ) ;
885
858
886
859
// VisibilityKind::Inherited
887
860
// Directly calling `stringify_vis!()` does not work.
0 commit comments