@@ -1625,7 +1625,7 @@ pub(crate) enum Type {
16251625 /// An array type.
16261626 ///
16271627 /// The `String` field is a stringified version of the array's length parameter.
1628- Array ( Box < Type > , String ) ,
1628+ Array ( Box < Type > , Box < str > ) ,
16291629 /// A raw pointer type: `*const i32`, `*mut i32`
16301630 RawPointer ( Mutability , Box < Type > ) ,
16311631 /// A reference type: `&i32`, `&'a mut Foo`
@@ -2210,7 +2210,7 @@ impl Span {
22102210#[ derive( Clone , PartialEq , Eq , Debug , Hash ) ]
22112211pub ( crate ) struct Path {
22122212 pub ( crate ) res : Res ,
2213- pub ( crate ) segments : Vec < PathSegment > ,
2213+ pub ( crate ) segments : ThinVec < PathSegment > ,
22142214}
22152215
22162216impl Path {
@@ -2360,7 +2360,7 @@ pub(crate) enum ConstantKind {
23602360 ///
23612361 /// Note that `ty::Const` includes generic parameters, and may not always be uniquely identified
23622362 /// by a DefId. So this field must be different from `Extern`.
2363- TyConst { expr : String } ,
2363+ TyConst { expr : Box < str > } ,
23642364 /// A constant (expression) that's not an item or associated item. These are usually found
23652365 /// nested inside types (e.g., array lengths) or expressions (e.g., repeat counts), and also
23662366 /// used to define explicit discriminant values for enum variants.
@@ -2388,7 +2388,7 @@ impl Constant {
23882388impl ConstantKind {
23892389 pub ( crate ) fn expr ( & self , tcx : TyCtxt < ' _ > ) -> String {
23902390 match * self {
2391- ConstantKind :: TyConst { ref expr } => expr. clone ( ) ,
2391+ ConstantKind :: TyConst { ref expr } => expr. to_string ( ) ,
23922392 ConstantKind :: Extern { def_id } => print_inlined_const ( tcx, def_id) ,
23932393 ConstantKind :: Local { body, .. } | ConstantKind :: Anonymous { body } => {
23942394 print_const_expr ( tcx, body)
@@ -2574,13 +2574,13 @@ mod size_asserts {
25742574 // tidy-alphabetical-start
25752575 static_assert_size ! ( Crate , 72 ) ; // frequently moved by-value
25762576 static_assert_size ! ( DocFragment , 32 ) ;
2577- static_assert_size ! ( GenericArg , 48 ) ;
2577+ static_assert_size ! ( GenericArg , 32 ) ;
25782578 static_assert_size ! ( GenericArgs , 32 ) ;
25792579 static_assert_size ! ( GenericParamDef , 56 ) ;
25802580 static_assert_size ! ( Generics , 16 ) ;
25812581 static_assert_size ! ( Item , 56 ) ;
2582- static_assert_size ! ( ItemKind , 88 ) ;
2582+ static_assert_size ! ( ItemKind , 64 ) ;
25832583 static_assert_size ! ( PathSegment , 40 ) ;
2584- static_assert_size ! ( Type , 48 ) ;
2584+ static_assert_size ! ( Type , 32 ) ;
25852585 // tidy-alphabetical-end
25862586}
0 commit comments