@@ -1625,7 +1625,7 @@ pub(crate) enum Type {
1625
1625
/// An array type.
1626
1626
///
1627
1627
/// The `String` field is a stringified version of the array's length parameter.
1628
- Array ( Box < Type > , String ) ,
1628
+ Array ( Box < Type > , Box < str > ) ,
1629
1629
/// A raw pointer type: `*const i32`, `*mut i32`
1630
1630
RawPointer ( Mutability , Box < Type > ) ,
1631
1631
/// A reference type: `&i32`, `&'a mut Foo`
@@ -2210,7 +2210,7 @@ impl Span {
2210
2210
#[ derive( Clone , PartialEq , Eq , Debug , Hash ) ]
2211
2211
pub ( crate ) struct Path {
2212
2212
pub ( crate ) res : Res ,
2213
- pub ( crate ) segments : Vec < PathSegment > ,
2213
+ pub ( crate ) segments : ThinVec < PathSegment > ,
2214
2214
}
2215
2215
2216
2216
impl Path {
@@ -2360,7 +2360,7 @@ pub(crate) enum ConstantKind {
2360
2360
///
2361
2361
/// Note that `ty::Const` includes generic parameters, and may not always be uniquely identified
2362
2362
/// by a DefId. So this field must be different from `Extern`.
2363
- TyConst { expr : String } ,
2363
+ TyConst { expr : Box < str > } ,
2364
2364
/// A constant (expression) that's not an item or associated item. These are usually found
2365
2365
/// nested inside types (e.g., array lengths) or expressions (e.g., repeat counts), and also
2366
2366
/// used to define explicit discriminant values for enum variants.
@@ -2388,7 +2388,7 @@ impl Constant {
2388
2388
impl ConstantKind {
2389
2389
pub ( crate ) fn expr ( & self , tcx : TyCtxt < ' _ > ) -> String {
2390
2390
match * self {
2391
- ConstantKind :: TyConst { ref expr } => expr. clone ( ) ,
2391
+ ConstantKind :: TyConst { ref expr } => expr. to_string ( ) ,
2392
2392
ConstantKind :: Extern { def_id } => print_inlined_const ( tcx, def_id) ,
2393
2393
ConstantKind :: Local { body, .. } | ConstantKind :: Anonymous { body } => {
2394
2394
print_const_expr ( tcx, body)
@@ -2574,13 +2574,13 @@ mod size_asserts {
2574
2574
// tidy-alphabetical-start
2575
2575
static_assert_size ! ( Crate , 72 ) ; // frequently moved by-value
2576
2576
static_assert_size ! ( DocFragment , 32 ) ;
2577
- static_assert_size ! ( GenericArg , 48 ) ;
2577
+ static_assert_size ! ( GenericArg , 32 ) ;
2578
2578
static_assert_size ! ( GenericArgs , 32 ) ;
2579
2579
static_assert_size ! ( GenericParamDef , 56 ) ;
2580
2580
static_assert_size ! ( Generics , 16 ) ;
2581
2581
static_assert_size ! ( Item , 56 ) ;
2582
- static_assert_size ! ( ItemKind , 88 ) ;
2582
+ static_assert_size ! ( ItemKind , 64 ) ;
2583
2583
static_assert_size ! ( PathSegment , 40 ) ;
2584
- static_assert_size ! ( Type , 48 ) ;
2584
+ static_assert_size ! ( Type , 32 ) ;
2585
2585
// tidy-alphabetical-end
2586
2586
}
0 commit comments