@@ -732,7 +732,7 @@ pub struct LocalDecl<'tcx> {
732
732
/// borrow checker needs this information since it can affect
733
733
/// region inference.
734
734
// FIXME(matthewjasper) Don't store in this in `Body`
735
- pub user_ty : UserTypeProjections ,
735
+ pub user_ty : Option < Box < UserTypeProjections > > ,
736
736
737
737
/// The *syntactic* (i.e., not visibility) source scope the local is defined
738
738
/// in. If the local was defined in a let-statement, this
@@ -818,7 +818,7 @@ pub struct LocalDecl<'tcx> {
818
818
819
819
// `LocalDecl` is used a lot. Make sure it doesn't unintentionally get bigger.
820
820
#[ cfg( target_arch = "x86_64" ) ]
821
- static_assert_size ! ( LocalDecl <' _>, 72 ) ;
821
+ static_assert_size ! ( LocalDecl <' _>, 56 ) ;
822
822
823
823
/// Extra information about a some locals that's used for diagnostics. (Not
824
824
/// used for non-StaticRef temporaries, the return place, or anonymous function
@@ -937,7 +937,7 @@ impl<'tcx> LocalDecl<'tcx> {
937
937
internal : false ,
938
938
is_block_tail : None ,
939
939
ty,
940
- user_ty : UserTypeProjections :: none ( ) ,
940
+ user_ty : None ,
941
941
source_info,
942
942
}
943
943
}
@@ -2451,14 +2451,18 @@ impl Constant<'tcx> {
2451
2451
/// &'static str`.
2452
2452
#[ derive( Clone , Debug , RustcEncodable , RustcDecodable , HashStable , TypeFoldable ) ]
2453
2453
pub struct UserTypeProjections {
2454
- pub ( crate ) contents : Vec < ( UserTypeProjection , Span ) > ,
2454
+ pub contents : Vec < ( UserTypeProjection , Span ) > ,
2455
2455
}
2456
2456
2457
2457
impl < ' tcx > UserTypeProjections {
2458
2458
pub fn none ( ) -> Self {
2459
2459
UserTypeProjections { contents : vec ! [ ] }
2460
2460
}
2461
2461
2462
+ pub fn is_empty ( & self ) -> bool {
2463
+ self . contents . is_empty ( )
2464
+ }
2465
+
2462
2466
pub fn from_projections ( projs : impl Iterator < Item = ( UserTypeProjection , Span ) > ) -> Self {
2463
2467
UserTypeProjections { contents : projs. collect ( ) }
2464
2468
}
0 commit comments