1
1
use std:: iter:: ExactSizeIterator ;
2
2
use std:: ops:: Deref ;
3
3
4
- use rustc_ast:: ast:: { self , AttrVec , FnRetTy , Mutability } ;
5
- use rustc_span:: { symbol:: kw, symbol :: Ident , BytePos , Pos , Span } ;
4
+ use rustc_ast:: ast:: { self , FnRetTy , Mutability } ;
5
+ use rustc_span:: { symbol:: kw, BytePos , Pos , Span } ;
6
6
7
+ use crate :: comment:: { combine_strs_with_missing_comments, contains_comment} ;
7
8
use crate :: config:: lists:: * ;
8
9
use crate :: config:: { IndentStyle , TypeDensity , Version } ;
9
10
use crate :: expr:: {
10
11
format_expr, rewrite_assign_rhs, rewrite_call, rewrite_tuple, rewrite_unary_prefix, ExprType ,
11
12
} ;
12
- use crate :: items:: StructParts ;
13
13
use crate :: lists:: {
14
14
definitive_tactic, itemize_list, write_list, ListFormatting , ListItem , Separator ,
15
15
} ;
@@ -24,11 +24,6 @@ use crate::utils::{
24
24
colon_spaces, extra_offset, first_line_width, format_extern, format_mutability,
25
25
last_line_extendable, last_line_width, mk_sp, rewrite_ident,
26
26
} ;
27
- use crate :: DEFAULT_VISIBILITY ;
28
- use crate :: {
29
- comment:: { combine_strs_with_missing_comments, contains_comment} ,
30
- items:: format_struct_struct,
31
- } ;
32
27
33
28
#[ derive( Copy , Clone , Debug , Eq , PartialEq ) ]
34
29
pub ( crate ) enum PathContext {
@@ -769,54 +764,6 @@ impl Rewrite for ast::Ty {
769
764
ast:: TyKind :: Tup ( ref items) => {
770
765
rewrite_tuple ( context, items. iter ( ) , self . span , shape, items. len ( ) == 1 )
771
766
}
772
- ast:: TyKind :: AnonymousStruct ( ref fields, recovered) => {
773
- let ident = Ident :: new (
774
- kw:: Struct ,
775
- mk_sp ( self . span . lo ( ) , self . span . lo ( ) + BytePos ( 6 ) ) ,
776
- ) ;
777
- let data = ast:: VariantData :: Struct ( fields. clone ( ) , recovered) ;
778
- let variant = ast:: Variant {
779
- attrs : AttrVec :: new ( ) ,
780
- id : self . id ,
781
- span : self . span ,
782
- vis : DEFAULT_VISIBILITY ,
783
- ident,
784
- data,
785
- disr_expr : None ,
786
- is_placeholder : false ,
787
- } ;
788
- format_struct_struct (
789
- & context,
790
- & StructParts :: from_variant ( & variant) ,
791
- fields,
792
- shape. indent ,
793
- None ,
794
- )
795
- }
796
- ast:: TyKind :: AnonymousUnion ( ref fields, recovered) => {
797
- let ident = Ident :: new (
798
- kw:: Union ,
799
- mk_sp ( self . span . lo ( ) , self . span . lo ( ) + BytePos ( 5 ) ) ,
800
- ) ;
801
- let data = ast:: VariantData :: Struct ( fields. clone ( ) , recovered) ;
802
- let variant = ast:: Variant {
803
- attrs : AttrVec :: new ( ) ,
804
- id : self . id ,
805
- span : self . span ,
806
- vis : DEFAULT_VISIBILITY ,
807
- ident,
808
- data,
809
- disr_expr : None ,
810
- is_placeholder : false ,
811
- } ;
812
- format_struct_struct (
813
- & context,
814
- & StructParts :: from_variant ( & variant) ,
815
- fields,
816
- shape. indent ,
817
- None ,
818
- )
819
- }
820
767
ast:: TyKind :: Path ( ref q_self, ref path) => {
821
768
rewrite_path ( context, PathContext :: Type , q_self. as_ref ( ) , path, shape)
822
769
}
0 commit comments