@@ -1621,7 +1621,7 @@ pub(crate) enum Type {
16211621 /// An array type.
16221622 ///
16231623 /// The `String` field is a stringified version of the array's length parameter.
1624- Array ( Box < Type > , String ) ,
1624+ Array ( Box < Type > , Box < str > ) ,
16251625 /// A raw pointer type: `*const i32`, `*mut i32`
16261626 RawPointer ( Mutability , Box < Type > ) ,
16271627 /// A reference type: `&i32`, `&'a mut Foo`
@@ -2206,7 +2206,7 @@ impl Span {
22062206#[ derive( Clone , PartialEq , Eq , Debug , Hash ) ]
22072207pub ( crate ) struct Path {
22082208 pub ( crate ) res : Res ,
2209- pub ( crate ) segments : Vec < PathSegment > ,
2209+ pub ( crate ) segments : ThinVec < PathSegment > ,
22102210}
22112211
22122212impl Path {
@@ -2356,7 +2356,7 @@ pub(crate) enum ConstantKind {
23562356 ///
23572357 /// Note that `ty::Const` includes generic parameters, and may not always be uniquely identified
23582358 /// by a DefId. So this field must be different from `Extern`.
2359- TyConst { expr : String } ,
2359+ TyConst { expr : Box < str > } ,
23602360 /// A constant (expression) that's not an item or associated item. These are usually found
23612361 /// nested inside types (e.g., array lengths) or expressions (e.g., repeat counts), and also
23622362 /// used to define explicit discriminant values for enum variants.
@@ -2384,7 +2384,7 @@ impl Constant {
23842384impl ConstantKind {
23852385 pub ( crate ) fn expr ( & self , tcx : TyCtxt < ' _ > ) -> String {
23862386 match * self {
2387- ConstantKind :: TyConst { ref expr } => expr. clone ( ) ,
2387+ ConstantKind :: TyConst { ref expr } => expr. to_string ( ) ,
23882388 ConstantKind :: Extern { def_id } => print_inlined_const ( tcx, def_id) ,
23892389 ConstantKind :: Local { body, .. } | ConstantKind :: Anonymous { body } => {
23902390 print_const_expr ( tcx, body)
@@ -2570,13 +2570,13 @@ mod size_asserts {
25702570 // tidy-alphabetical-start
25712571 static_assert_size ! ( Crate , 72 ) ; // frequently moved by-value
25722572 static_assert_size ! ( DocFragment , 32 ) ;
2573- static_assert_size ! ( GenericArg , 48 ) ;
2573+ static_assert_size ! ( GenericArg , 32 ) ;
25742574 static_assert_size ! ( GenericArgs , 32 ) ;
25752575 static_assert_size ! ( GenericParamDef , 56 ) ;
25762576 static_assert_size ! ( Generics , 16 ) ;
25772577 static_assert_size ! ( Item , 56 ) ;
2578- static_assert_size ! ( ItemKind , 88 ) ;
2578+ static_assert_size ! ( ItemKind , 64 ) ;
25792579 static_assert_size ! ( PathSegment , 40 ) ;
2580- static_assert_size ! ( Type , 48 ) ;
2580+ static_assert_size ! ( Type , 32 ) ;
25812581 // tidy-alphabetical-end
25822582}
0 commit comments