@@ -732,7 +732,7 @@ pub struct LocalDecl<'tcx> {
732732 /// borrow checker needs this information since it can affect
733733 /// region inference.
734734 // FIXME(matthewjasper) Don't store in this in `Body`
735- pub user_ty : UserTypeProjections ,
735+ pub user_ty : Option < Box < UserTypeProjections > > ,
736736
737737 /// The *syntactic* (i.e., not visibility) source scope the local is defined
738738 /// in. If the local was defined in a let-statement, this
@@ -818,7 +818,7 @@ pub struct LocalDecl<'tcx> {
818818
819819// `LocalDecl` is used a lot. Make sure it doesn't unintentionally get bigger.
820820#[ cfg( target_arch = "x86_64" ) ]
821- static_assert_size ! ( LocalDecl <' _>, 72 ) ;
821+ static_assert_size ! ( LocalDecl <' _>, 56 ) ;
822822
823823/// Extra information about a some locals that's used for diagnostics. (Not
824824/// used for non-StaticRef temporaries, the return place, or anonymous function
@@ -937,7 +937,7 @@ impl<'tcx> LocalDecl<'tcx> {
937937 internal : false ,
938938 is_block_tail : None ,
939939 ty,
940- user_ty : UserTypeProjections :: none ( ) ,
940+ user_ty : None ,
941941 source_info,
942942 }
943943 }
@@ -2451,14 +2451,18 @@ impl Constant<'tcx> {
24512451/// &'static str`.
24522452#[ derive( Clone , Debug , RustcEncodable , RustcDecodable , HashStable , TypeFoldable ) ]
24532453pub struct UserTypeProjections {
2454- pub ( crate ) contents : Vec < ( UserTypeProjection , Span ) > ,
2454+ pub contents : Vec < ( UserTypeProjection , Span ) > ,
24552455}
24562456
24572457impl < ' tcx > UserTypeProjections {
24582458 pub fn none ( ) -> Self {
24592459 UserTypeProjections { contents : vec ! [ ] }
24602460 }
24612461
2462+ pub fn is_empty ( & self ) -> bool {
2463+ self . contents . is_empty ( )
2464+ }
2465+
24622466 pub fn from_projections ( projs : impl Iterator < Item = ( UserTypeProjection , Span ) > ) -> Self {
24632467 UserTypeProjections { contents : projs. collect ( ) }
24642468 }
0 commit comments