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